How to display a msg box while opening a sheet

R

Rajesh

Hi,
I have a XLS file with many sheets in that. What I am looking for is - whenever that XLS file is opened (i mean any sheet) then if the file is opened for the first time in a NEW MONTH then a dialog box is displayed with a custom message and OK & cancel button. Pressing CANCEL would not display that message again for this given month but Pressing OK would display this message again and again until CANCEL.

This process should repeat for any new month.
Pls. someone help me write that type of program/macro.
 
P

Patrick Molloy

If format$(Date,"MMMYYY") <> _
format$(sheets("Main").Range("A1"),"MMMYYYY")
then


-----Original Message-----
Hi,
I have a XLS file with many sheets in that. What I am
looking for is - whenever that XLS file is opened (i mean
any sheet) then if the file is opened for the first time
in a NEW MONTH then a dialog box is displayed with a
custom message and OK & cancel button. Pressing CANCEL
would not display that message again for this given month
but Pressing OK would display this message again and
again until CANCEL.
 
R

Rajesh

Thanx Sir,
But please let me know where should I place this code...I assume it is a macro.
Do I need any special value in any particular shell or a sheet for this to work.

Thanx again
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top