quick question on why the below vba for printing won't work... If I have it set up individually (Sheet1.PrintOut) it prints out fine, but if I do it as array(Sheet1, Sheet2, Sheet3).PrintOut it doesn't work. Can anyone explain why?
Sub printnow()
Dim Sheet1 As Worksheet
Dim Sheet2 As Worksheet
Dim Sheet3 As Worksheet
With ThisWorkbook
Set Sheet1 = .Sheets("database1")
Set Sheet2 = .Sheets("database2")
Set Sheet3 = .Sheets("database3")
'Setting up the print setup
Sheet3.PageSetup.PaperSize = xlPaperLegal
Sheet3.PageSetup.Orientation = xlPortrait
'Print
End With
Array(Sheet1,Sheet2.Sheet3).PrintOut Copies:=1
End Sub
ThisWorkbook.Sheets(Array("database1", "database2", "database3")).PrintOut Copies:=1- that would be equivalent to Excel's "Print Active Sheets" option if you had selected multiple sheets.