Print Activesheet.next.select problem

g4cox

New Member
Joined
Sep 9, 2009
Messages
41
Please can anyone help me I am having a problem with a print marco should be really simple but I keep getting a run time error.
I am trying to print a sheet then use ActiveSheet.Next.Select then print (using a Do Until Loop) again etc but when it gets to the last sheet it then hits a run time error any ideas??

Thanks Gareth[FONT=&quot]<o:p></o:p>[/FONT]
 

Excel Facts

Is there a shortcut key for strikethrough?
Ctrl+S is used for Save. Ctrl+5 is used for Strikethrough. Why Ctrl+5? When you use hashmarks to count |||| is 4, strike through to mean 5.
You shouldn't need to select sheets. Try like this

Code:
Sub prt()
Dim i As Long
For i = 1 To Worksheets.Count
    Worksheets(i).PrintOut
Next i
End Sub
 
Upvote 0
Code:
Sub G2()
    Dim sh As Worksheet
    For Each sh In Worksheets
        sh.PrintOut
    Next
End Sub
 
Upvote 0

Forum statistics

Threads
1,224,594
Messages
6,179,792
Members
452,942
Latest member
VijayNewtoExcel

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