Frank Freese
asked on
Print and Print Preview
In a module I have the following code:
In a command button I call the module code:
My objective is to have the user select a Print Option through a command button (there will be hundereds of worksheets (each with a Print command button). They can select Print Preview and Print or simply Print. When I select Print Preview I get a only the first row; When I select Print I get a blank sheet of paper. Therefore, I must have something wrong in my module.
Sub PrintSheet()
Dim UserResponse
UserResponse = MsgBox(Prompt:="Print Worksheet", Buttons:=vbYesNoCancel, Title:="Print Worksheet")
Select Case UserResponse
Case vbCancel
Exit Sub
Case vbYes
Selection.PrintOut
Case Else
Selection.PrintOut Preview:=True
End Select
End sub
In a command button I call the module code:
Sub cmdPrintProduction_Click()
PrintSheet
End Sub
My objective is to have the user select a Print Option through a command button (there will be hundereds of worksheets (each with a Print command button). They can select Print Preview and Print or simply Print. When I select Print Preview I get a only the first row; When I select Print I get a blank sheet of paper. Therefore, I must have something wrong in my module.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
thank you
I appreciate it
I appreciate it
You're very welcome.
Good luck with the rest of your project.
Good luck with the rest of your project.
ASKER
ActiveSheet.PrintOut Preview:=True
These worked
Thanks