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

Unmerge and copy data into Mastersheet

karthikgoel

New Member
I have macro that merges data from different worksheets into Master sheet all the sheets have the same columns.
the macro works fine when there are no merged rows in worsheets. but with merged cells in some worksheets it does not pull all the records (it only pulls one record) from the worksheet. Have included the macro code below and also attached the file. how do I ensure that all the data is copied from all worksheets into Master sheet ?
(note: row 1 & 2 are headers)


Code:
Sub SummurizeSheets()
    Dim ws As Worksheet
   
    Application.ScreenUpdating = False
    Sheets("Master").Activate
    'Optional Clears the specific range in the Master sheet except header
    Sheets("Master").Range("A3:G150").Clear
       
    For Each ws In Worksheets
        If ws.Name <> "Master" Then
              ws.Range("A3:G150").Copy
            ActiveSheet.Paste Range("A65536").End(xlUp).Offset(1, 0)
        End If
    Next ws
End Sub
 

Attachments

  • Combine Multiple Worksheets into Master_v3.xlsm
    29.6 KB · Views: 2
Back
Top