Select multiple sheets on a dinamic context

  • Thread starter Thread starter bliten_bsas
  • Start date Start date
B

bliten_bsas

Hi, I've built a model in which the user is able to add new sheets and
I'd like to make a print macro that selects only certain sheets. The
catch is that there are certain sheets which I don't want to print and
there will be new sheets (added by the user) that should be printed...
How could I do this?
 
You could use an array, like so:

Sub PrintSome()
Dim ws As Worksheet
For Each ws In ThisWorkbook.Worksheets(Array("Sheet1", "Sheet3"))
ws.PrintOut
Next ws
End Sub

James
 
was sure surprised to run into this. Just down my alley.
useing this code I have many sheets some named others numbered. should the
numbered sheets be refered to by number only? not as "sheet1" only "1".
Anyway I will start and see what happens
Thanks
 

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