Help with Macro

R

Rajula

I have used the following macro. The logic goes like this
If the paper size selected is A3, then print page 1 of every sheet,
If paper size selected is A4, then print page 1 & 2 of every sheet.

Its giving an error for .PageSetup.. What is wrong with the macro??

For Each wks In ActiveWorkbook.Worksheets
If .PageSetup.PaperSize = A3 Then
wks.PrintOut from:=1, to:=1, preview:=True
Else
wks.PrintOut from:=1, to:=2, preview:=True
 
Top