V
vvaidya
Hello:
I am trying to write VBA code to display a message in the Workbook,
BeforePrint event.
I have three worksheets in the workbook, named SheetA, SheetB, and
SheetC.
I want a different message to show depending upon whether SheetA is the
active sheet, or SheetB or SheetC
The code would look something like this:
Private Sub Workbook_BeforePrint(Cancel As Boolean)
If ActiveSheet = Sheets("SheetA") Then MsgBox "Hello"
etc etc
End Sub
Obviously, I am not using the correct syntax "ActiveSheet" as it is
giving me an error.
I would appreciate if you could help me with the correct syntax
TIA
Vinay
I am trying to write VBA code to display a message in the Workbook,
BeforePrint event.
I have three worksheets in the workbook, named SheetA, SheetB, and
SheetC.
I want a different message to show depending upon whether SheetA is the
active sheet, or SheetB or SheetC
The code would look something like this:
Private Sub Workbook_BeforePrint(Cancel As Boolean)
If ActiveSheet = Sheets("SheetA") Then MsgBox "Hello"
etc etc
End Sub
Obviously, I am not using the correct syntax "ActiveSheet" as it is
giving me an error.
I would appreciate if you could help me with the correct syntax
TIA
Vinay