![]() |
Selective Printing of Excel Worksheets using Macro
I need a VBS script for an Excel Macro to print a worksheet but only if one
of the fields on the sheet has been filled. At the moment my Macro prints every worksheet that might be needed and I'm wasting a ton of paper and ink every time. Any help :) Dan |
Selective Printing of Excel Worksheets using Macro
Try this:-
Sub selectiveprint() Dim wSheet As Worksheet For Each wSheet In Worksheets wSheet.Select If Cells(1, 1).Value = "Print Me" Then wSheet.PrintOut End If Next wSheet End Sub Mike "Daniel Clough" wrote: I need a VBS script for an Excel Macro to print a worksheet but only if one of the fields on the sheet has been filled. At the moment my Macro prints every worksheet that might be needed and I'm wasting a ton of paper and ink every time. Any help :) Dan |
All times are GMT +1. The time now is 05:27 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com