+ Reply to Thread
Results 1 to 5 of 5

Auto Display a Message Box

  1. #1

    Auto Display a Message Box

    I am using the Today function on several worksheets (same cell address)
    in a workbook file. I also have due dates listed in various locations
    on all of the worksheets within the workbook.

    Is it possible to write code that can compare each due date with the
    system date, and if the information is due today or is past due,
    display a message box?

    I will be most appreciative of any help or direction someone might
    offer. This one has me stumped.

    Thanks,
    Karen


  2. #2
    Tom Ogilvy
    Guest

    RE: Auto Display a Message Box

    are you talking about manually running a macro that will check the dates?

    If you just want to mark them, look at Data=>Validation.

    --
    Regards,
    Tom Ogilvy


    "[email protected]" wrote:

    > I am using the Today function on several worksheets (same cell address)
    > in a workbook file. I also have due dates listed in various locations
    > on all of the worksheets within the workbook.
    >
    > Is it possible to write code that can compare each due date with the
    > system date, and if the information is due today or is past due,
    > display a message box?
    >
    > I will be most appreciative of any help or direction someone might
    > offer. This one has me stumped.
    >
    > Thanks,
    > Karen
    >
    >


  3. #3

    Re: Auto Display a Message Box

    Thanks for replying Tom. I want the dates checked when the file is
    opened, and a message to display if the due dates are >= Current Date.
    Is that possible?

    Karen

    Tom Ogilvy wrote:
    > are you talking about manually running a macro that will check the dates?
    >
    > If you just want to mark them, look at Data=>Validation.
    >
    > --
    > Regards,
    > Tom Ogilvy
    >
    >
    > "[email protected]" wrote:
    >
    > > I am using the Today function on several worksheets (same cell address)
    > > in a workbook file. I also have due dates listed in various locations
    > > on all of the worksheets within the workbook.
    > >
    > > Is it possible to write code that can compare each due date with the
    > > system date, and if the information is due today or is past due,
    > > display a message box?
    > >
    > > I will be most appreciative of any help or direction someone might
    > > offer. This one has me stumped.
    > >
    > > Thanks,
    > > Karen
    > >
    > >



  4. #4
    Forum Contributor
    Join Date
    01-21-2005
    Location
    Colorado
    MS-Off Ver
    2000,2003,2007
    Posts
    481
    Karen,
    In the ThisWorkbook module you can use a Workbook_Open event handler.
    When the workbook opens it will run any code you have there. Put your code to loop through all the worksheets on in ThisWorkbook (use a For Each Worksehet in ThisWorkbook loop) and check your due date against 'Date'. The example assumes your due date is in Range A1. If your due date ends up in a different cell on each worksheet then this will complicate things.

    Please Login or Register  to view this content.
    HTH
    Last edited by bhofsetz; 08-03-2006 at 12:54 PM.

  5. #5

    Re: Auto Display a Message Box

    I think this will do the job! The fact that you included the sample
    code was the BEST! Thank you so much for your assistance.


    bhofsetz wrote:
    > Karen,
    > In the ThisWorkbook module you can use a Workbook_Open event
    > handler.
    > When the workbook opens it will run any code you have there. Put your
    > code to loop through all the worksheets on in ThisWorkbook (use a For
    > Each Worksehet in ThisWorkbook loop) and check your due date against
    > 'Date'. The example assumes your due date is in Range A1. If your due
    > date ends up in a different cell on each worksheet then this will
    > complicate things.
    >
    >
    > Code:
    > --------------------
    > Private Sub Workbook_Open()
    > Dim wks As Object
    > For Each wks In ThisWorkbook.Worksheets
    > If wks.Range("A1") <= Date Then
    > wks.Activate
    > wks.Range("A1").Select
    > MsgBox "This project is overdue!"
    > End If
    > Next wks
    > End Sub
    >
    > --------------------
    >
    >
    > HTH
    >
    >
    > --
    > bhofsetz
    > ------------------------------------------------------------------------
    > bhofsetz's Profile: http://www.excelforum.com/member.php...o&userid=18807
    > View this thread: http://www.excelforum.com/showthread...hreadid=567944



+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1