Print Visible Sheets Macro

L

Lisa C.

I would like to create a button and assign a macro that automatically prints
all visible sheets but doesn't print hidden sheets. What should the vb
syntax look like that would accomplish this and run the fastest? I want to
avoid having to provide the name of the visible sheets if possible because
there are different scenarios and I won't know what sheets are visible at any
given time. If this is not possible, I need to know how to write the syntax
to say if sheet named X is visible, then print, otherwise don't print.
 
S

Sheeloo

Use
Sub printVisible()
For Each ws In Worksheets
If ws.Visible = True Then
'Your Print commands
End If
Next ws
End Sub
 

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

Top