Hello,
I have 30 worksheets.
I want to create a dynamic print range across multiple worksheet within one workbook.
The following code works however I need to run this macro once at a time for all sheets.
1. Is there a way to automatically run this macro across all worksheets?
2. Is there a way to automatically run this macro for only a number of worksheets (or not run for some worksheets)
Thanks.
I have 30 worksheets.
I want to create a dynamic print range across multiple worksheet within one workbook.
The following code works however I need to run this macro once at a time for all sheets.
1. Is there a way to automatically run this macro across all worksheets?
2. Is there a way to automatically run this macro for only a number of worksheets (or not run for some worksheets)
Sub PrintArea()
Dim LastRow As Long
LastRow = Range("A" & Rows.Count).End(xlUp).Row
While Len(Cells(LastRow, 1).Value) = 0
LastRow = LastRow - 1
Wend
Range("A1:I" & LastRow).Name = "Print_Area"
'ActiveSheet.PrintOut
End Sub
Thanks.