I have the following code...
Sub SheetsToSummary()
Dim LastRow As Long
Dim ws As Worksheet
Dim wsMaster As Worksheet
Set wsMaster = Worksheets("Master Data Collection")
For Each ws In ThisWorkbook.Worksheets
With ws
If .Name <> wsMaster.Name Then
If .Range("A1").Value = "Item" Then
LastRow = .Cells(.Rows.Count, "A").End(xlUp).Row
.Range(.Cells(2, "A"), .Cells(LastRow, "D")).copy
With wsMaster
' finds last used cell in column A and moves down a row
LastRow = .Cells(.Rows.Count, "A").End(xlUp).Row + 1
.Cells(LastRow, "A").PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False
End With
End If
End If
End With
Next ws
End Sub
I would like the code to copy the last populated Column as well as the last populated row. It currently works fine with the last populated row but it only copies the first 4 columns and the number of columns varies on each worksheet. I have tried some different variation of writing for the last column but it keeps on causing errors. PLEASE HELP!!!!
Thanks!
Bookmarks