• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Stacking /Consolidating Excel Worksheets into a master sheet

I'm reaching out trying to execute stacking multiple worksheets into a master one. In the attached, file I want to stack the data in both the (Analysis / Analysis 2) worksheets into the Master one. The Master worksheet is in the same format as the other two worksheets (Analysis/Analysis 2).

I have referenced this link below: VBA copying ranges, but I need to stack/merge the data. I ran the Consolidating Macro in the link, but got a userform error stating sub or function not defined. I appreciate the help her.

https://msdn.microsoft.com/en-us/library/cc793964.aspx
 

Attachments

  • Stacking Worksheets.xlsx
    73.4 KB · Views: 0
Hi Brian ,

You need to copy the two functions LastRow and LastCol to your workbook , since these functions are being made use of in the procedure
CopyRangeFromMultiWorksheets()

Even after this , the procedure will not work because the copy range needs to be modified.

Even after this , the result will not be what you are looking for since the headers on the Summary Sheet tab do not match the headers on the Analysis tabs.

See the attached file.

Narayan
 

Attachments

  • Stacking Worksheets.xlsm
    82.9 KB · Views: 1
If I may ask, all 3 worksheets have the same formats in terms of columns & rows. What is preventing the macro to break code? The headers from my review definitely match up here.
 
Hi Brian ,

Sorry , my mistake ; when the macro executes , it is inserting the tab name from where it picks up the data in a column in the Summary Sheet. Run the macro and see if it works the way you want it to.

Narayan
 
Back
Top