Good Morning,
I've got a VBA query in a report which copies all the data and consolidates onto one sheet (there is a tab for each working day of the month) now to reduce to size of the file,
I want to put this code in a standalone spreadsheet that would open the existing file, and then copy all the data from each of the tabs and then paste them into this new workbook.
Is this possible?
This is the code in the existing workbook
Sub Master()
Worksheets("master").Visible = True
Worksheets("CC").Visible = True
Worksheets("WIP").Visible = True
Dim Sht As Worksheet
For Each Sht In ActiveWorkbook.Worksheets
If Sht.Name <> "Master" And Sht.Range("A2").Value <> "" Then
Sht.Select
LastRow = Range("A65536").End(xlUp).Row
Range("A2", Cells(LastRow, "AA")).Copy
Sheets("Master").Select
Range("A65536").End(xlUp).Offset(1, 0).Select
ActiveSheet.Paste
Sht.Select
Sheets("Master").Select
Range("A1").Select
Else
End If
Next Sht
I've got a VBA query in a report which copies all the data and consolidates onto one sheet (there is a tab for each working day of the month) now to reduce to size of the file,
I want to put this code in a standalone spreadsheet that would open the existing file, and then copy all the data from each of the tabs and then paste them into this new workbook.
Is this possible?
This is the code in the existing workbook
Sub Master()
Worksheets("master").Visible = True
Worksheets("CC").Visible = True
Worksheets("WIP").Visible = True
Dim Sht As Worksheet
For Each Sht In ActiveWorkbook.Worksheets
If Sht.Name <> "Master" And Sht.Range("A2").Value <> "" Then
Sht.Select
LastRow = Range("A65536").End(xlUp).Row
Range("A2", Cells(LastRow, "AA")).Copy
Sheets("Master").Select
Range("A65536").End(xlUp).Offset(1, 0).Select
ActiveSheet.Paste
Sht.Select
Sheets("Master").Select
Range("A1").Select
Else
End If
Next Sht