macro won't work on multiple sheets

excelmacro

Board Regular
Joined
Apr 8, 2002
Messages
50
This macro is to print out certain ranges on a sheet on different pages, and i have a button on each sheet to print that sheet, but the macro only works for one sheet. Any suggestions with what is wrong in this coding?

Sub PrintMacro()
Range("A1:K38").Select
With ActiveSheet.PageSetup
.PrintTitleRows = ""
.PrintTitleColumns = ""
End With
ActiveSheet.PageSetup.PrintArea = ""
With ActiveSheet.PageSetup
.Orientation = xlLandscape
.PaperSize = xlPaperLetter
.FirstPageNumber = xlAutomatic
.FitToPagesWide = 1
.FitToPagesTall = 1
Application.Dialogs

(xlDialogPrinterSetup).Show

End With
ActiveWindow.SmallScroll Down:=22
Range("A39:C66").Select
Selection.PrintOut Copies:=1, Collate:=True
Range("A67:C84").Select
Selection.PrintOut Copies:=1, Collate:=True
ActiveWindow.LargeScroll Down:=-3
Range("A1:K38").Select
Selection.PrintOut Copies:=1, Collate:=True
ActiveWindow.SmallScroll ToRight:=10
ActiveWindow.LargeScroll Down:=-1
Range("L1:V32").Select
Selection.PrintOut Copies:=1, Collate:=True
ActiveWindow.LargeScroll Down:=-1
Range("X1:Z40").Select
With ActiveSheet.PageSetup
.PrintTitleRows = ""
.PrintTitleColumns = ""
End With
ActiveSheet.PageSetup.PrintArea = ""
With ActiveSheet.PageSetup
.Orientation = xlPortrait
.PaperSize = xlPaperLetter
.FirstPageNumber = xlAutomatic
.FitToPagesWide = 1
.FitToPagesTall = 1
End With
Selection.PrintOut Copies:=1, Collate:=True
Range("A1:A2").Select
End Sub
 

Excel Facts

How can you turn a range sideways?
Copy the range. Select a blank cell. Right-click, Paste Special, then choose Transpose.

Forum statistics

Threads
1,213,535
Messages
6,114,192
Members
448,554
Latest member
Gleisner2

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top