This will ask for a page range and print the specified range.
You could make a custom form to get both inputs at the same time and you
could also put in code to skip the print step if cancel is selected. This
will crash if both inputs are not given, but this is a quick and easy fix.
Sub Macro2()
x = Application.InputBox(prompt:="Start Page", Type:=1)
y = Application.InputBox(prompt:="End Page", Type:=1)
ActiveWindow.SelectedSheets.PrintOut From:=x, To:=y, Copies:=1
End Sub
This will ask for a page range and print the specified range.
You could make a custom form to get both inputs at the same time and you
could also put in code to skip the print step if cancel is selected. This
will crash if both inputs are not given, but this is a quick and easy fix.
Sub Macro2()
x = Application.InputBox(prompt:="Start Page", Type:=1)
y = Application.InputBox(prompt:="End Page", Type:=1)
ActiveWindow.SelectedSheets.PrintOut From:=x, To:=y, Copies:=1
End Sub
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.