Re: Copy Data From Multiple Sheets To One Master Sheet
Thank you Dave,
After making that change the data that did transfer actually looked pretty good. But now I get a new error.
The error is "Run-Time error '1004': Application-defined or object-defined error".
If I debug it brings me the orange line below.
Sub SummurizeSheets()
Dim ws As Worksheet
Dim lastRng As Range
Dim lastCll As Range
Application.ScreenUpdating = False
Sheets("Master List").Activate
For Each ws In Worksheets
Set lastRng = Range("A65536").End(xlUp).Offset(1, 0)
Select Case ws.Name
Case "Master List", "Map"
'do nothing
Case Else
Set lastCll = ws.Columns(2).Find(What:="*", After:=ws.Range("B1"), SearchDirection:=xlPrevious)
ws.Range("B2:" & lastCll.Address).Copy
Cells(Rows.Count, 2).End(xlUp).Offset(1, 0).PasteSpecial (xlPasteValues)
'add sheet name before data
[COLOR="Orange"]lastRng.Resize(lastCll.Row - 1) = ws.Name[/COLOR]
End Select
Next ws
Columns("B").SpecialCells(xlBlanks).EntireRow.Delete (xlUp)
Application.ScreenUpdating = True
End Sub
Display More
Thank you again.
Actually after looking at the data again I notice I'm only getting the data for column B. I still need to have all the data in B:K. I'm not sure if this is because of the error above.