Looping

B

Buffyslay

hi all

i want to loop through the currentRegion and do a different thing for
each col - this just gives me the same value in each one - i can see it
does that but cannot see how to move along !! arrgggh!!



For Each c In ActiveCell.CurrentRegion.Cells

'MsgBox c
sOut = sOut & "<note>"
sOut = sOut & groupTitle & c & groupTitleEND
sOut = sOut & mapping & c & mappingEND
sOut = sOut & Description & c & DescriptionEND
sOut = sOut & budgetCode & c & budgetCodeEND
sOut = sOut & budgetCodePT & c & budgetCodePTEND
sOut = sOut & budgetCodeLU & c & budgetCodeLUEND
sOut = sOut & "</note>"

Next
 
D

Dave Peterson

You sure you're just not seeing the first part of the string.

For Each c In ActiveCell.CurrentRegion.Cells

'set it to "" to start
sOut = ""

'MsgBox c
sOut = sOut & "<note>"
sOut = sOut & groupTitle & c & groupTitleEND
sOut = sOut & mapping & c & mappingEND
sOut = sOut & Description & c & DescriptionEND
sOut = sOut & budgetCode & c & budgetCodeEND
sOut = sOut & budgetCodePT & c & budgetCodePTEND
sOut = sOut & budgetCodeLU & c & budgetCodeLUEND
sOut = sOut & "</note>"

'do something with sOut
c.value = sout '????

Next C 'cause I like it!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top