Printing most of the Excel worksheets

AndreasL

New member
Joined
Oct 12, 2011
Messages
4
Reaction score
0
Points
0
Hi,

due to working with an Exceltool I want that a VBA- Programm prints out 8 of ten worksheets. The problem for me is now, that I have to initialice a printer and that I den't know how I could programm that not all worksheets would be printed out.

Thanke you very much for your help
 

Bob Phillips

Super Moderator
Staff member
Joined
Mar 21, 2011
Messages
1,940
Reaction score
0
Points
36
Excel Version(s)
O365
You could try this

Code:
Dim sh As String

    For Each sh In Array("Sheet1", "Sheet2") '<<<<<<<< add your sheets
    
        Worksheets(sh).Print
    Next sh
 
Top