ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Print sheets in a worbook. (https://www.excelbanter.com/excel-programming/295616-print-sheets-worbook.html)

Bobby T

Print sheets in a worbook.
 
I have a workbook with around 70 sheets in it
Each sheet, when printed, covers around 2-3 pages. I only need to print off page 1 of each sheet
I tried the following macro, but it printed just the one sheet 70 times
Could someone suggest a change so it does all sheets, and not just the one

Sub TestPrint(
Dim ws As Workshee

For Each ws In Worksheet
On Error GoTo
ActiveSheet.PrintOut From:=1, To:=
Next w

End Su

TIA

Bobby

humejap[_3_]

Print sheets in a worbook.
 
Try this

Sub TestPrint()
Dim ws As Worksheet

For Each ws In Worksheets
On Error GoTo 0
ws.PrintOut From:=1, To:=1
Next ws

End Sub

Although you were looping through the worksheets you were printing th
Active sheet each time

--
Message posted from http://www.ExcelForum.com


Bobby T

Print sheets in a worbook.
 
Thanks heaps. :)


All times are GMT +1. The time now is 05:10 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com