How do I print only certain tabs in an Excel file.
+2
A:
From the UI - go to the desired worksheet and go to File -> Print
From VBA -
Call Worksheets("MySheet").PrintOut
or
Call MySheet.PrintOut
or if you have a more than one
Dim shts As New Collection
Call shts.Add(Sheet1)
Call shts.Add(Sheet3)
Call shts.Add(Sheet5)
Dim sht As Worksheet: For Each sht In shts
Call sht.PrintOut
Next sht
AdamRalph
2009-05-29 07:54:02
A:
Click on the worksheet you want to print, select print and under print click 'active sheet'.
Full details here - MS Office Help Page for Excel printing.
Neosionnach
2009-05-29 08:38:47
'Active sheet' is the default selection
AdamRalph
2009-05-29 12:55:24
You can also Ctrl-left-click or Shift-left-click on the tab names to group the sheets before printing
barrowc
2009-05-29 23:49:29
A:
It works as an array too:
Thisworkbook.Sheets(array("Sheet1", "Sheet3", "Sheet5")).Printout
or:
Dim arString(1 to 3) as string
arString(1) = "Sheet1"
arString(2) = "Sheet3"
arString(3) = "Sheet5"
Thisworkbook.Sheets(arString).Printout
Either way would work.
JustPlainBill
2009-06-01 23:44:34