+ Reply to Thread
Results 1 to 2 of 2

Help:Looping

  1. #1
    Buffyslay
    Guest

    Help:Looping

    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


  2. #2
    Dave Peterson
    Guest

    re: Help:Looping

    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!

    Buffyslay wrote:
    >
    > 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


    --

    Dave Peterson

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1