Printing worksheets

B

Brent

I am trying to write a program that will print out sheets depending on a
number in a cell on the first sheet. I want the pages printed to be
duplexed, but can only get them to come out single sided. any suggestions?
here is the code for the first for sheets.

Private Sub PRINT_PCW_Click()
Dim Vio_Num As Integer
Vio_Num = Sheets("Summary").Range("H13").Value
Sheets("Summary").PageSetup.PrintArea = "$A$1:$J$57"
Sheets("Summary").Select
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
Sheets("Comphist").PageSetup.PrintArea = "$A$1:$L$35"
Sheets("Comphist").Select
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
If Vio_Num > 0 Then
Sheets("V1").PageSetup.PrintArea = "$A$1:$L$52"
Sheets("V1").Select
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
Sheets("EB1").PageSetup.PrintArea = "$A$1:$H$32"
Sheets("EB1").Select
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
End If
End Sub
 
T

Tom Ogilvy

Private Sub PRINT_PCW_Click()
Dim Vio_Num As Integer
Vio_Num = Sheets("Summary").Range("H13").Value
Sheets("Summary").PageSetup.PrintArea = "$A$1:$J$57"
Sheets("Comphist").PageSetup.PrintArea = "$A$1:$L$35"
If Vio_Num > 0 Then
Sheets("V1").PageSetup.PrintArea = "$A$1:$L$52"
Sheets("EB1").PageSetup.PrintArea = "$A$1:$H$32"
WorkSheets(Array("Summary","Comphist","V1","EB1")).Printout _
Copies:=1, Collate:=True
Else
WorkSheets(Array("Summary","Comphist")).PrintOut _
Copies:=1, Collate:=True
End If
End Sub
 

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

Similar Threads

Printing Macro 4
landscape printing 0
inputbox syntax location 3
? Object What object 1
Command Button 6
combind print copy amount 1
Pop Up Message before printing 3
Page Breaks in VBA Q 6

Top