Hello Experts:
I am new to VBA and can use some expertise/advice. I am working in Excel 2010 and trying to find a code that auto populates data to a "Master" sheet when entered or deleted throughout entire worksheets.
My workbook has Three sheets "Master" "Tracker" and "Archive". The "Tracker" and "Archive" sheets have columns A:U first row using headers.
My "Master" sheets has newly added columns making range "A:Z"
I researched other threads but cannot find a code that works with my spreadsheet.
I believe its due to the newly added columns in my "Master" sheet. I added Column A to use as a number sequence 1,2,3,4,5 starting from A2. I added columns G:J extracting date from Received date from Column B on my "Master" sheet to run Pivots and reports.
Thank you in advance. I also attached a copy of my spreadsheet as a reference.
Below is a code I attached to my "Master" sheet.
Private Sub Worksheet_Activate()
Dim Sheet As Worksheet
For Each Sheet In Me.Parent.Sheets
If Sheet.Name <> Me.Name Then
If Sheet.Cells(Rows.Count, 1).End(xlUp).Row <> 1 Then
Sheet.Range(Sheet.Cells(2, 1), Sheet.Cells(Sheet.Cells(Rows.Count, 1).End(xlUp).Row, 21)).Copy Destination:=Me.Cells(Rows.Count, 1).End(xlUp).Offset(1, 0)
End If
Else
Me.Range(Cells(2, 1), Cells(Rows.Count, 21)).Clear
End If
Next Sheet
End Sub
Bookmarks