Selective Printing of Excel Worksheets using Macro

  • Thread starter Thread starter Daniel Clough
  • Start date Start date
D

Daniel Clough

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
 
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top