Hi all,
I am using VBA to copy the first 10 rows (including Headers) of data in every sheet of a workbook to a "master", or summary, sheet. The number of columns changes from sheet to sheet, and the total number of sheets will change as well (over time). After I copy each selection, I want to transpose the data before pasting to my summary sheet, and then I want all data concatenated (just pasted one after the other with no gaps).
Here's what I have:
Currently, I'm getting an "Error:424 - Object Required" on the line where I select the range of cells to copy. If you see any issues in the next line, I am all ears!
Thank you so much!!!
FYI - This is my second topic I've posted; it's been a while, but I hope to become an engaged member!
I am using VBA to copy the first 10 rows (including Headers) of data in every sheet of a workbook to a "master", or summary, sheet. The number of columns changes from sheet to sheet, and the total number of sheets will change as well (over time). After I copy each selection, I want to transpose the data before pasting to my summary sheet, and then I want all data concatenated (just pasted one after the other with no gaps).
Here's what I have:
Code:
Sub Copy_Tpose_to_MSTR()
'The purpose of this macro is to copy the first ten rows, including headers, of every sheet to a single summary sheet.
Dim WB As Workbook
Dim SHT As Worksheet
Application.ScreenUpdating = False
For Each SHT In WB.Worksheets
If SHT.Name <> "Master" Then
SHT.Range("A1:A10" & ActiveSheet.Cells.SpecialCells(xlCellTypeLastCell).Row.Select).Copy
Sheets("Master").Cells(Rows.Count, "A").End(xlUp).Offset(1).PasteSpecial Transpose:=True
End If
Next
Application.ScreenUpdating = True
End Sub
Currently, I'm getting an "Error:424 - Object Required" on the line where I select the range of cells to copy. If you see any issues in the next line, I am all ears!
Thank you so much!!!
FYI - This is my second topic I've posted; it's been a while, but I hope to become an engaged member!