Hello,
I want to copy data from multiple sheets (dynamic columns and rows) to one master sheet but my code doesn't work and i don't have any idea where is a problem... I would be very grateful for any help.
My code:
Sub copy_data_to_master_sheet()
Rowsnotmaster = Range("A1048576").End(xlUp).Row
Columnsnotmaster = Range("XFD3").End(xlToLeft).Column
For i = 2 To Worksheets.Count
'copy data from multiple sheets
Worksheets(i).Range(Cells(3, 1), Cells(Rowsnotmaster, Columnsnotmaster)).Copy
Worksheets("Master").Select
'paste data to master sheet
Master_row = Cells(Rows.Count, 1).End(xlUp).Row + 1
Selection.Cells(Master_row, 1).PasteSpecial
Next
End Sub
I want to copy data from multiple sheets (dynamic columns and rows) to one master sheet but my code doesn't work and i don't have any idea where is a problem... I would be very grateful for any help.
My code:
Sub copy_data_to_master_sheet()
Rowsnotmaster = Range("A1048576").End(xlUp).Row
Columnsnotmaster = Range("XFD3").End(xlToLeft).Column
For i = 2 To Worksheets.Count
'copy data from multiple sheets
Worksheets(i).Range(Cells(3, 1), Cells(Rowsnotmaster, Columnsnotmaster)).Copy
Worksheets("Master").Select
'paste data to master sheet
Master_row = Cells(Rows.Count, 1).End(xlUp).Row + 1
Selection.Cells(Master_row, 1).PasteSpecial
Next
End Sub