Hi,
I am not sure that what I am trying to do is possible but this is what I need (and not able to achieve). I do have an excel file with different Sheets and, on activating a sheet a message appear.
As example this is the code on Sheet6:
Private Sub Worksheet_Activate()
MsgBox "You shouldn't be here."
End Sub
I would like to have a YES/NO message in ThisWorkbook with Workbook_Open() where an user will receive a question like "do you want to display guide" Y/N.
If Y is selected the message will be displayed if N is selected then the messages won't be displayed. So I do need a global variable where to store the answer to the question on opening the file and, with an if function, on activating the other Sheets the message will be displayed or not.
So, as example, the previous code on Sheet6 would be:
Private Sub Worksheet_Activate() 'not sure at this point is it is still correct to use the Private Sub definition
if answer=YES then
MsgBox "You shouldn't be here."
endif
End Sub
I tried different ways but I am not too confident with global variable and, after reading a lot in different forums, at this point I am not even sure that you can define a global variable in the ThisWorkbook Sheet and neither if global variable are working within Sheets Sub (on some sites they way saying, if I understood correctly, that global variable can be defined and used only within module.
Any idea on how to make the above working, if possible?
Thank you for the help.
Bookmarks