I'm trying to resolve an issue with printing a sheet in Excel. So I was wondering whether there is a way to allow printing via button only. In ThisWorkbook I put the code below. What should I put in a module? How to pass 'button_used' variable from module back to ThisWorkbook?
Public Sub Workbook_BeforePrint(Cancel As Boolean)
'disables print if button is not used
If button_used = False Then MsgBox "Print is disabled, use button" Cancel = True End If End Sub
Public Sub Workbook_BeforePrint(Cancel As Boolean)
'disables print if button is not used
If button_used = False Then MsgBox "Print is disabled, use button" Cancel = True End If End Sub