G
Graham H
I use the procedure below to print out a variable number of print areas, each of which
takes up a page which it fills fine. I have the facility with a networked printer to print
duplex so that I can do both sides of a sheet of paper. I can set the printer to do this
prior to printing but on this procedure it will always just print one side of an A4 sheet.
Is there anyway to modify the code below so that if the printer is set to duplex then it
will be printed out in that way? i appreciate any help.
Regards.
Graham
Sub NewPrintAllFields()
Dim rng As Range
Dim r As Integer
Application.ScreenUpdating = False
r = Sheets("Entries").Cells(Rows.Count, "A").End(xlUp).row
For Each c In Sheets("Entries").Range("A12:A" & r)
' check if sheet exists
If WksExists(c.Value) Then
With Sheets(c.Value).PageSetup
.PrintArea = "$B$1:$O$48"
.Orientation = xlLandscape
.PaperSize = xlPaperA4
.Zoom = False
.FitToPagesWide = 1
.FitToPagesTall = 1
Sheets(c.Value).PrintOut Collate:=True
End With
Else
MsgBox "There are no Fields to print. Operation cancelled.", vbInformation, "Print
Cancelled"
Exit Sub
End If
Next
End Sub
takes up a page which it fills fine. I have the facility with a networked printer to print
duplex so that I can do both sides of a sheet of paper. I can set the printer to do this
prior to printing but on this procedure it will always just print one side of an A4 sheet.
Is there anyway to modify the code below so that if the printer is set to duplex then it
will be printed out in that way? i appreciate any help.
Regards.
Graham
Sub NewPrintAllFields()
Dim rng As Range
Dim r As Integer
Application.ScreenUpdating = False
r = Sheets("Entries").Cells(Rows.Count, "A").End(xlUp).row
For Each c In Sheets("Entries").Range("A12:A" & r)
' check if sheet exists
If WksExists(c.Value) Then
With Sheets(c.Value).PageSetup
.PrintArea = "$B$1:$O$48"
.Orientation = xlLandscape
.PaperSize = xlPaperA4
.Zoom = False
.FitToPagesWide = 1
.FitToPagesTall = 1
Sheets(c.Value).PrintOut Collate:=True
End With
Else
MsgBox "There are no Fields to print. Operation cancelled.", vbInformation, "Print
Cancelled"
Exit Sub
End If
Next
End Sub