Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Correct Syntax | Excel Discussion (Misc queries) | |||
Correct VBA syntax | Excel Discussion (Misc queries) | |||
Correct way to call active worksheet? | Excel Programming | |||
If...and... - can never get the syntax correct! | Excel Programming | |||
Can't get this syntax correct, please help. | Excel Programming |