Print workbook tabs based on a selection list

C

Cpinto

I am wondering if it is possible to create a print macro that will only print
the worksheets associated to a list of worksheets in a single workbook. In
this workbook there is a worksheet tab that allows the user to make
selections for the different worksheets they need to print and I would like
to be able to use the selection as criteria on which worksheets to print from
a single macro button.

Is this possible in Excel?
 
J

Jacob Skaria

Try the below macro. I understand you are selecting the list of sheetnames//

Sub Macro()
Dim varCell As Range, varRange As Range
Set varRange = Selection
Application.DisplayAlerts = False
For Each varCell In varRange
If Trim(varCell.Text) <> "" Then
Sheets(varCell.Text).PrintOut Copies:=1, Collate:=True
End If
Next
Application.DisplayAlerts = True
End Sub

If this post helps click Yes
 

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