ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Printing Multiple Worksheets (https://www.excelbanter.com/excel-programming/296401-printing-multiple-worksheets.html)

TroyH

Printing Multiple Worksheets
 
Why does this not work

Private Sub PrnSheet_Click(
Dim Sht As Workshee

For Each Sht In ActiveWorkbook.Worksheet
Sht.PrintOu
Next Sh
End Su

I keep getting the error

Run-time error '1004'
Method 'PrintOut' of object '_Worksheet' failed

Bob Flanagan

Printing Multiple Worksheets
 
Is one of the sheets empty? You can determine which sheet it is by setting
a watch on Sht.Name.

Bob Flanagan
Macro Systems
http://www.add-ins.com
Productivity add-ins and downloadable books on VB macros for Excel

"TroyH" wrote in message
...
Why does this not work?

Private Sub PrnSheet_Click()
Dim Sht As Worksheet

For Each Sht In ActiveWorkbook.Worksheets
Sht.PrintOut
Next Sht
End Sub

I keep getting the error:

Run-time error '1004':
Method 'PrintOut' of object '_Worksheet' failed





All times are GMT +1. The time now is 06:08 PM.

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