+ Reply to Thread
Results 1 to 3 of 3

Issues with a FOR loop & need help with a concatenate macro

  1. #1
    Registered User
    Join Date
    03-05-2012
    Location
    Chicago
    MS-Off Ver
    2007
    Posts
    25

    Issues with a FOR loop & need help with a concatenate macro

    I have a FOR loop set up that basically copies column T from one sheet to column A on another sheet. With the macro I have written, it copies every other cell rather than every cell.

    Please Login or Register  to view this content.
    gives me

    Please Login or Register  to view this content.
    I'm not sure how to edit this so that I get the entire row copied instead of every even cell in the row. I've tried adding another variable x and incrementing that by 1 every iteration, but I got the same result.


    Secondly, my client wants me to have some sort of output listing all employee emails as a comma separated list so he can quickly copy/paste that into a To: email field. I already have a code that gathers all of the employees into a single column. How can I take an entire column and have it automatically create a comma separated list that exports either into a specific cell or into a text document? The length of the column will be variable, as well, as it automatically updates any time there is a change in staff, but it should not go over 50 total employees.

  2. #2
    Forum Expert
    Join Date
    01-15-2007
    Location
    Brisbane, Australia
    MS-Off Ver
    2007
    Posts
    6,591

    Re: Issues with a FOR loop & need help with a concatenate macro

    Hi

    1) issue is with the formula. The [] in the formula means that you are offsetting from the current position by the number contained within the []. So for your first row, it will offset row 1 by 1 thereby referring to row2. If you want to absolute things, then remove the [].

    2) The code below will take data from column B and put the concatenated, comma separated string into A1.
    Please Login or Register  to view this content.
    rylo

  3. #3
    Registered User
    Join Date
    03-05-2012
    Location
    Chicago
    MS-Off Ver
    2007
    Posts
    25

    Re: Issues with a FOR loop & need help with a concatenate macro

    The concatenate macro worked perfectly, and I'll be trying your solution to my first problem tonight. Thanks!

+ 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