colinharwood
Active Member
- Joined
- Jul 27, 2002
- Messages
- 426
- Office Version
- 2019
- Platform
- Windows
Hi
I am trying to get the following code to loop through 12 sheets. On each sheet it should copy a range and then paste it on the print sales sheet, starting at the first blank row and then return to the original sheet.
I cant work out how to find the last row on the print sale sheet.
Any help much appreciated
I am trying to get the following code to loop through 12 sheets. On each sheet it should copy a range and then paste it on the print sales sheet, starting at the first blank row and then return to the original sheet.
I cant work out how to find the last row on the print sale sheet.
Any help much appreciated
VBA Code:
Sub PrintSheetSales()
Dim lastrow
Application.ScreenUpdating = False
lastrow = Range("A5000").End(xlUp).Offset(1, 0).Row
Range("A8: M8").Select
Selection.AutoFilter
ActiveSheet.Range("$A$8:$M$180").AutoFilter Field:=3, Criteria1:="0"
Range("A9:M" & lastrow).Select
Selection.Copy
Sheets("Print Sales").Range("A" & lastrow).PasteSpecial Paste:=xlPasteValues
Selection.AutoFilter
End Sub