+ Reply to Thread
Results 1 to 5 of 5

Copy data from every nth column into another spreadsheet

  1. #1
    Registered User
    Join Date
    05-27-2013
    Location
    Middle, Nowhere
    MS-Off Ver
    Excel 2003
    Posts
    13

    Copy data from every nth column into another spreadsheet

    I've written a macro to copy the 5th,11th,...,n+6th column of the first row and paste it into as single column on a separate spreadsheet. it would then go back to the original spreadsheet and repeat with the next row and so on.

    Please Login or Register  to view this content.
    The problem now is, I am only getting data from the last column (i.e. 63). How come none of the data from the previous columns are pasted into the second spreadsheet.

  2. #2
    Forum Expert
    Join Date
    04-22-2013
    Location
    .
    MS-Off Ver
    .
    Posts
    4,418

    Re: Copy data from every nth column into another spreadsheet

    the line cells(modmaxrows+1,9).pastespecial is what is pasting the data into the column. Both the row (modmaxrow+1) and the column (9) remain unchanged as you loop through the columns from 1 to 63, therefore it will just overwrite each column until you get to 63.

  3. #3
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Copy data from every nth column into another spreadsheet

    Please Login or Register  to view this content.
    is looping from 2 to 49 in sheet11.

    Why do you need to loop again on sheet12?
    Please Login or Register  to view this content.
    If you are copying from sheet11 and paste them in sheet12, you need to loop in sheet11.

    For e.g
    Please Login or Register  to view this content.
    loops from column to 63 every 6th column

  4. #4
    Forum Expert
    Join Date
    04-22-2013
    Location
    .
    MS-Off Ver
    .
    Posts
    4,418

    Re: Copy data from every nth column into another spreadsheet

    Maybe you can simplify this to:
    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    05-27-2013
    Location
    Middle, Nowhere
    MS-Off Ver
    Excel 2003
    Posts
    13

    Re: Copy data from every nth column into another spreadsheet

    wow worked like a charm! thanks yudlugar(:

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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