View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Doo0592 Doo0592 is offline
external usenet poster
 
Posts: 42
Default Code to run dialogue box at workbook startup

Actually Rafeek, I think I understand your code now. If I am right it
will only execute once per month? If I am right, is there a way we can
combine your code with Carlo's. I think it will probably annoy my end
users if this msg box executes every time they open the workbook! lol

ta :)

Doo
Doo0592 wrote:

Thanks folks.

Not sure I understand your code either Rafeek. I get that you are
trying to reference cell AA1 as the date but it didn't seem to execute
properly when I made the date the first of the month... it did work
when there was no date in AA1 at all thou! lol

Carlo.. I think I understand your code. If Now() calls the system date
for today and "DD" the actual date, if DD= the first of the month then
the msgbox will run. Am I right?
Also, is there a way I can test this without having wait till the
beginning of the month? lol (even thou it is only 2 days away!)

Thanks again all xx
Doo

Carlo wrote:

I think Rafeek has misunderstood you slightly!
try this:

Private Sub Workbook_Open()
If Format(Now(), "DD") = 1 Then
MsgBox "It's the first of the month"
End If
End Sub

If I did misunderstand you, then I apologize for any
inconvenience.

Cheers
Carlo

"Doo0592" wrote:

Howdy,

Can anyone suggest code to run a dialogue box when a workbook opens but
only on the first of every month?

Ta :)