ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   ThisWorkbook.Print question (https://www.excelbanter.com/excel-discussion-misc-queries/166596-thisworkbook-print-question.html)

Dave

ThisWorkbook.Print question
 
Hi Everyone!

I want to write a line into a macro that will print all worksheets in a
workbook, apart from a sheet called "HOME".

Can anyone tell me how to do this?

Thanks
Dave

Gord Dibben

ThisWorkbook.Print question
 
Private Sub Workbook_BeforePrint(Cancel As Boolean)
For Each ws In ActiveWorkbook.Worksheets
If ws.Name < "HOME" Then ws.PrintOut
Next ws
End Sub


Gord Dibben MS Excel MVP

On Mon, 19 Nov 2007 07:38:03 -0800, Dave wrote:

Hi Everyone!

I want to write a line into a macro that will print all worksheets in a
workbook, apart from a sheet called "HOME".

Can anyone tell me how to do this?

Thanks
Dave




All times are GMT +1. The time now is 12:11 PM.

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