Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default 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


" 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default 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


" 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Auto Display a Message Box


Karen,
In the ThisWorkbook module you can use a Workbook_Open even
handler.
When the workbook opens it will run any code you have there. Put you
code to loop through all the worksheets on in ThisWorkbook (use a Fo
Each Worksehet in ThisWorkbook loop) and check your due date agains
'Date'. The example assumes your due date is in Range A1. If your du
date ends up in a different cell on each worksheet then this wil
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

-------------------


HT

--
bhofset
-----------------------------------------------------------------------
bhofsetz's Profile: http://www.excelforum.com/member.php...fo&userid=1880
View this thread: http://www.excelforum.com/showthread.php?threadid=56794

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default 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
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
if, then display message puiuluipui Excel Discussion (Misc queries) 1 October 2nd 09 05:28 AM
Display a message Jarek Kujawa[_2_] Excel Worksheet Functions 0 June 3rd 08 02:44 PM
Display a message Ridhi Excel Worksheet Functions 4 June 3rd 08 02:43 PM
Message Display Barb Reinhardt Excel Programming 5 October 25th 05 04:10 PM
How to display a message box Salman[_2_] Excel Programming 1 November 5th 03 05:01 PM


All times are GMT +1. The time now is 09:24 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"