So I'm very new to VBA, basically learning it for my first job.
I have data from a filtered pivot table in Sheet3. This data is updated monthly, I need to copy this dynamic data (excluding the headings and the blanks when the data ends) to a new sheet (sheet8) in the next available row as other data will be copied there too from other pivot tables.
What I have tried so far is
Sub Aggregate_Data()
'
' Aggregate_Data Macro
'
Sheet3.Activate
LR = Sheet3.Cells(Rows.Count, 1).End(xlUp).Row
For i = 3 To LR
If Sheet3.Cells(i, 1).Value <> "0" Then
Sheet3.Rows(i).Copy
Sheet8.Cells(Rows.Count, 1).End(xlUp).Offset(1, 0).EntireRow.Select
Selection.PasteSpecial xlPasteValues
End If
Next i
End Sub
I have no idea what I'm doing really, so sorry if this code makes no sense. But basically I keep getting a run-time error "1004"