Hello Gurus,
How to print all pages in a series 1, 5, 9, 13, 17, 21... til last page.
I want the user to select
a. first page and
b. the series.
If the user selects 1 in option a , then begin printing from 1st page, and if the user selects 5 in the series, then print every 5th page. just like the series above.
The following is a macro that prints odd or even pages.
How to print all pages in a series 1, 5, 9, 13, 17, 21... til last page.
I want the user to select
a. first page and
b. the series.
If the user selects 1 in option a , then begin printing from 1st page, and if the user selects 5 in the series, then print every 5th page. just like the series above.
The following is a macro that prints odd or even pages.
VBA Code:
Sub PrintOddEven()
Dim TotalPages As Long
Dim StartPage As Long
Dim Page As Integer
TotalPages = Application.ExecuteExcel4Macro("GET.DOCUMENT(50)")
StartPage = InputBox("Enter starting page number")
If StartPage > 0 Then
For Page = StartPage To TotalPages Step 2
ActiveSheet.PrintOut From:=Page, To:=Page, _
Copies:=1, Collate:=True
Next
End If
End Sub