• 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.

Merge multiple Sheets into one

Lasantha

Member
Dear All,

Is there any method to merge multiple sheets into one sheet. in my worksheet I have more than 50 individual sheet. I need to combine them all.

thank you
Lasantha.
 
Code:
Private Sub CommandButton1_Click()

Dim WS1, WScur As Worksheet

Set WS1 = Sheets("YTD16")
For i = 2 To ActiveWorkbook.Worksheets.Count
        lrow1 = WS1.Cells(Rows.Count, 2).End(xlUp).Row + 1
        Set WScur = Sheets(i)
        lrow = WScur.Cells(Rows.Count, 1).End(xlUp).Row
        WScur.Range("a8:j" & lrow).Copy WS1.Range("b" & lrow1)
   
Next i

End Sub

You will need to edit sheet names, etc.
 

Attachments

  • consilidate worksheet data to one sheet.xlsm
    27.3 KB · Views: 5
Will you pls share a sample file and expected output so that we may suggest a alternate method if available...
 
Back
Top