cjsmile2016
New Member
- Joined
- Jan 24, 2005
- Messages
- 14
I have a macro that I recieved from a board member that I can't seem to get working right. I should mention I new to VB.
Problem is when I try to hide it using Private Sub I'm not longer able to use the shortkey I assigned it "Ctrl+b". Also how do you create a button for it?
Module
Public booOKToPrint As Boolean
Private Sub PrintMePlease()
booOKToPrint = True
ActiveSheet.PrintOut
End Sub
Workbook
Private Sub Workbook_BeforePrint(Cancel As Boolean)
If Not booOKToPrint Then
MsgBox "Printing Disabled!", vbCritical, "Print Canceled"
End If
Cancel = Not booOKToPrint
booOKToPrint = False
End Sub
Thank you for your assistance!
Tim
Problem is when I try to hide it using Private Sub I'm not longer able to use the shortkey I assigned it "Ctrl+b". Also how do you create a button for it?
Module
Public booOKToPrint As Boolean
Private Sub PrintMePlease()
booOKToPrint = True
ActiveSheet.PrintOut
End Sub
Workbook
Private Sub Workbook_BeforePrint(Cancel As Boolean)
If Not booOKToPrint Then
MsgBox "Printing Disabled!", vbCritical, "Print Canceled"
End If
Cancel = Not booOKToPrint
booOKToPrint = False
End Sub
Thank you for your assistance!
Tim