+ Reply to Thread
Results 1 to 13 of 13

Macro to copy columns and paste into one column in next blank column

  1. #1
    Registered User
    Join Date
    06-06-2013
    Location
    Wisconsin
    MS-Off Ver
    Excel 2010
    Posts
    38

    Macro to copy columns and paste into one column in next blank column

    Sorry if my title is confusing!

    I have multiple columns of data all on the same worksheet, in my example file it's called "Data". I need them to be copied and pasted into a different worksheet, "Collection", but be formatted so that they're "stacked"
    If there are blanks in the column I need those to copy over as well as the column titles. Also each time the macro is run it paste into the next empty column in the tab Collection. This way I can have an ongoing trend being created.

    I have searched for the answer and come close a couple times but it's never exactly what I need. I hope you can help!!

    Thanks in advance!!
    Attached Files Attached Files

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

    Re: Macro to copy columns and paste into one column in next blank column

    Try the attached.
    Attached Files Attached Files

  3. #3
    Forum Expert nilem's Avatar
    Join Date
    10-22-2011
    Location
    Ufa, Russia
    MS-Off Ver
    2013
    Posts
    3,377

    Re: Macro to copy columns and paste into one column in next blank column

    as an option
    Please Login or Register  to view this content.

  4. #4
    Registered User
    Join Date
    06-06-2013
    Location
    Wisconsin
    MS-Off Ver
    Excel 2010
    Posts
    38

    Re: Macro to copy columns and paste into one column in next blank column

    Thank you both!! Both of these codes work perfectly!!
    Now hopefully when I apply it to my real file I get the same results =)

    Thank you again!!!!

  5. #5
    Registered User
    Join Date
    06-06-2013
    Location
    Wisconsin
    MS-Off Ver
    Excel 2010
    Posts
    38

    Re: Macro to copy columns and paste into one column in next blank column

    Just a quick question, for either of the codes. Is there a way to edit where the columns start? For example one of my sheets the columns start in column "G", and in the other it starts at column "L". Is this possible to include?

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

    Re: Macro to copy columns and paste into one column in next blank column

    For I= 1 to LC
    where 1 is column A and if you want to start at column G= 7

  7. #7
    Registered User
    Join Date
    06-06-2013
    Location
    Wisconsin
    MS-Off Ver
    Excel 2010
    Posts
    38

    Re: Macro to copy columns and paste into one column in next blank column

    That solves that problem! But for some reason it's not pasting the column into the next blank column? If I rerun the macro with different data it just pastes beneath the other one.
    Last edited by rmmohan; 07-31-2013 at 10:07 AM.

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

    Re: Macro to copy columns and paste into one column in next blank column

    The code pastes in to next empty row in column A, not in to next column. It only pastes in to a single column. Your description of the thread and sample do seem to contradict to each other. Is next blank column, or next empty row as your sample shows?

  9. #9
    Registered User
    Join Date
    06-06-2013
    Location
    Wisconsin
    MS-Off Ver
    Excel 2010
    Posts
    38

    Re: Macro to copy columns and paste into one column in next blank column

    I want the multiple columns to paste beneath each other like it does. But the next time I run the macro I need an entirely new column. So it'd be a history of columns.
    I changed the example file to show what I mean. The numbers would be different in column "A" & "C" though in the "collection" tab because it would be new data. Just every time the macro runs it should continue to stack the columns just in a new empty column.
    Attached Files Attached Files

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

    Re: Macro to copy columns and paste into one column in next blank column

    This code works whenever you run it, but the first empty column will be column B, not A.
    Attached Files Attached Files

  11. #11
    Registered User
    Join Date
    06-06-2013
    Location
    Wisconsin
    MS-Off Ver
    Excel 2010
    Posts
    38

    Re: Macro to copy columns and paste into one column in next blank column

    This is exactly what I wanted! Thank you so much!! I'm sure pasting the format is a simple fix even I can figure out.
    Thanks again, I really really appreciate it!

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

    Re: Macro to copy columns and paste into one column in next blank column

    If you do not have formulae, you can use this line

    Please Login or Register  to view this content.

  13. #13
    Registered User
    Join Date
    06-06-2013
    Location
    Wisconsin
    MS-Off Ver
    Excel 2010
    Posts
    38

    Re: Macro to copy columns and paste into one column in next blank column

    perfect!!!

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Macro to Copy and Paste a Column to the next available empty column
    By ekr in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-03-2013, 02:50 AM
  2. Macro to copy values from columns of one sheet & paste it to diffrnt Column Sequence
    By kmvasudha in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 02-06-2013, 06:54 AM
  3. [SOLVED] Macro Help. Copy Hyperlink url from Column A and paste its image into Column B
    By kdela1212 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 01-04-2013, 09:00 AM
  4. Copy Data from Column and Paste to Next Blank Column on 2nd Sheet
    By adammark in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 04-19-2010, 11:15 AM
  5. find last non blank cell in a column and copy paste in next row
    By prasad_tavva in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-31-2007, 09:41 AM

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