Results 1 to 4 of 4
  1. #1
    Silver Lounger
    Join Date
    Dec 2000
    Location
    Northampton, Northamptonshire, England
    Posts
    1,951
    Thanks
    2
    Thanked 1 Time in 1 Post
    I have a weekly report which also has a quarterly report to fill in, I was wondering if there was a way to get a message box to pop up when it is due, I would only want it to pop up for 5 days eg April 1st to Apri the 5th, obviously being based on a 5 day date I could then adapt 1t to the other quarters.

    I would be most grateful for any help.

    I am using Excel 2007 but would need to save as Excel 2003 workbook.

    Regards

    Braddy
    If you are a fool at forty, you will always be a fool

  2. #2
    Super Moderator RetiredGeek's Avatar
    Join Date
    Mar 2004
    Location
    Manning, South Carolina
    Posts
    9,433
    Thanks
    371
    Thanked 1,456 Times in 1,325 Posts
    Braddy,

    This should do it. I assumed from your message you wanted this message to pop up on the 1st 5 Business days and coded accordingly. If this is not the case just change the value in the 1st If statement to 6.
    Code:
    Option Explicit
    
    Sub FirstFiveWorkDays()
    
       If Month(Now()) Mod 3 = 1 Then
    
         If Day(Now()) < 8 Then
       
           If Weekday(Day(Now()), vbMonday) < 5 Then
             MsgBox "Time to do Report", vbOKOnly, "Reminder"
           End If
         
         End If
    
       End If
         
    End Sub       'FirstFiveWorkdays
    Place this code in the Auto_Open() event of the workbook.

    Edit: Braddy, I just re-read your post and noticed the Quarterly bit. You could just add {see above} another If to test for Month so you would only get it on April, July, Oct, & Jan.
    May the Forces of good computing be with you!

    RG

    PowerShell & VBA Rule!

    My Systems: Desktop Specs
    Laptop Specs

  3. #3
    Silver Lounger
    Join Date
    Dec 2000
    Location
    Northampton, Northamptonshire, England
    Posts
    1,951
    Thanks
    2
    Thanked 1 Time in 1 Post
    Hi Retired Geek

    Thanks for your prompt answer, I will try it out.

    Thanks again

    Braddy
    If you are a fool at forty, you will always be a fool

  4. #4
    Silver Lounger
    Join Date
    Dec 2000
    Location
    Northampton, Northamptonshire, England
    Posts
    1,951
    Thanks
    2
    Thanked 1 Time in 1 Post
    Hi

    You code was excellent, I reset my pc to Monday Oct 4th and sure enough up popped the message.

    Many Many Thanks

    Braddy
    If you are a fool at forty, you will always be a fool

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •