Michael van den Berg
New Member
Awesome excel wizards,
Does anyone know how to print specific pages within a print area?
Through code I put specific sheets in a printarea to pool them together, now i want to be able to exclude specific pages from the printarea.
With the .PrintOut options you can add the From and To option to make a continous selection to print. However I want to print for example page 1-5, 7-8. Is this possible?
How would the code look like?
The alternative would be to copy the file copy everything to values and then delete the rows).
Greets
Michael
Does anyone know how to print specific pages within a print area?
Through code I put specific sheets in a printarea to pool them together, now i want to be able to exclude specific pages from the printarea.
With the .PrintOut options you can add the From and To option to make a continous selection to print. However I want to print for example page 1-5, 7-8. Is this possible?
How would the code look like?
The alternative would be to copy the file copy everything to values and then delete the rows).
Greets
Michael
Code:
Option Explicit
Sub PrintButton_Click()
If Application.Dialogs(xlDialogPrinterSetup).Show = False Then
MsgBox "Geannuleerd"
Exit Sub
End If
Application.ScreenUpdating = False
Dim i As Integer
For i = 5 To 12
If Sheets(1).Range("D" & i).Value = 1 Then Sheets(i - 4).Select False
Next
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True, IgnorePrintAreas:=False
Sheets(1).Select
Application.ScreenUpdating = True
End Sub