+ Reply to Thread
Results 1 to 6 of 6

Stacking columns across multiple sheets

  1. #1
    Registered User
    Join Date
    12-19-2008
    Location
    Arizona
    Posts
    3

    Stacking columns across multiple sheets

    Hi,

    I hope this question has not been answered. I did search and found some similar questions but could not get any of the solutions to fit my exact situation.

    What I want to do is take column 'A' and column 'B' from several worksheets and stack them together in a new worksheet.

    IE
    Sheet1
    A B
    -----
    1 A
    2 A


    Sheet2
    A B
    -----
    3 B
    4 B
    5 B

    Sheet 3
    A B
    -----
    6 C
    7 C

    Stacked into

    Sheet4
    A B
    -----
    1 A
    2 A
    3 B
    4 B
    5 B
    6 C
    7 C

    Is this possible? I currently just copy and paste it of course but that gets old as we update the information in each sheet quite often.

    Thanks in advance!

    Michael Stinson

  2. #2
    Administrator JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492
    This little macro will do it:

    Please Login or Register  to view this content.
    Last edited by JBeaucaire; 12-19-2008 at 02:43 PM. Reason: Corrected code, added "clear sheet4" section at the beginning.
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    “None of us is as good as all of us” - Ray Kroc
    “Actually, I *am* a rocket scientist.” - JB (little ones count!)

  3. #3
    Registered User
    Join Date
    12-19-2008
    Location
    Arizona
    Posts
    3
    Thanks!

    This seems to bomb however when I hit sheet 3. I took out sheet 3 and it does exactly what I want with sheet 1 and 2. When I leave 3 in it gives me either a '400' if I run it from the macro window...or a 'Run-time error '1004': Application-defined or object-defined error' if I run it from the vb window.

    Any ideas? The 3 worksheet example above is actually just an example...there are quite a number of tabs more that I really need to compile. Will this scale up to as many tabs as I need?

    Michael Stinson
    Last edited by mstinson23; 12-19-2008 at 04:07 PM.

  4. #4
    Administrator JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492
    If you want me to troubleshoot your sheet, you'll have to post it. No idea why it won't work as designed since it does on mine...maybe a sheet naming error?

    Also, yes, it will scale up as high as needed. Make sure you're using the last version I posted, the earliest version had a few lines of unneeded code.

  5. #5
    Forum Contributor
    Join Date
    02-27-2008
    Posts
    762

    macro

    Hi
    you may try the macro in the attached file.
    Ravi
    Attached Files Attached Files

  6. #6
    Registered User
    Join Date
    12-19-2008
    Location
    Arizona
    Posts
    3

    Re: Stacking columns across multiple sheets

    Ravi,

    I thought we had solved this a different way so I hadn't been back...but I just discovered I still needed this and found your macro. It works great...thanks!

    Michael

+ 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