I was hoping to create a module that would basically operate like so:
- Define 4 or 5 print ranges;
- Prompt a user an input box;
- Allow the user to select, from a drop down in that input box, the range they wish to print;
- After selecting the range, they hit OK, and are prompted by a "are you sure?" box to prevent mistaken clicks.
I'm fairly lost on this and I honestly feel like the code I've been writing will be less help than just articulating the problem.
I have had it work by the user defining the range (manually selecting the columns they wish to print), but that's not what I'm looking for.
One step further, would it be possible to allow for the customization of the print format (landscape vs portrait, and paper type) even further?
Thanks so much for the help in advance, I'll do my best to answer questions and provide samples of the code I referenced above (just a prompt that allows you to select the columns. I need it to be a defined range, by name, range1=a2:c14
or something like that, because the end user is not a great excel user.
See below:
Sub SelectPrintArea()
Dim PrintThis As Range
ActiveSheet.PageSetup.PrintArea = ""
Set PrintThis = Application.InputBox _
(Prompt:="Select the Print Range", Title:="Select", Type:=8)
PrintThis.Select
Selection.Name = "NewPrint"
ActiveSheet.PageSetup.PrintArea = "NewPrint"
ActiveSheet.PrintPreview
End Sub
As a follow-up:
Assume the document has hidden sections, would it be able to unhide those sections if they are part of a user defined range (like if it was part of a grouping). Would this work on a protected document?