Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I want to put various times into an excel spreadsheet, when these times are
reached I need excel to display a message box with a warning and a ok button to acknowledge. Any ideas how to go about this. |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
You can enter a date/time in a range, say A1.
Then in the Open, SelectionChange or Change events of the worksheet, compare the value to the current time. If Range("A1").Value<Now() Then MsgBox "Time passed" End Is that what you mean ? NickHK "Mariner" wrote in message ... I want to put various times into an excel spreadsheet, when these times are reached I need excel to display a message box with a warning and a ok button to acknowledge. Any ideas how to go about this. |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Try Excel's OnTime. Here is an example to start you off.
Enter a date (with time) in cell A4 and another in A5. Run the setTimes macro. Sub setTimes() Application.OnTime earliesttime:=Range("A4"), procedu="RunWhat", _ schedule:=True, latesttime:=Range("A4") + TimeSerial(0, 0, 30) Application.OnTime earliesttime:=Range("A5"), procedu="RunWhat", _ schedule:=True, latesttime:=Range("A5") + TimeSerial(0, 0, 30) End Sub Sub RunWhat() MsgBox "The time is " & Now() End Sub Mariner wrote: I want to put various times into an excel spreadsheet, when these times are reached I need excel to display a message box with a warning and a ok button to acknowledge. Any ideas how to go about this. -- Message posted via OfficeKB.com http://www.officekb.com/Uwe/Forums.a...mming/200607/1 |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hello
I am trying to get this to work but as I am new to this, where do I put the code. Thanks "skatonni via OfficeKB.com" wrote: Try Excel's OnTime. Here is an example to start you off. Enter a date (with time) in cell A4 and another in A5. Run the setTimes macro. Sub setTimes() Application.OnTime earliesttime:=Range("A4"), procedu="RunWhat", _ schedule:=True, latesttime:=Range("A4") + TimeSerial(0, 0, 30) Application.OnTime earliesttime:=Range("A5"), procedu="RunWhat", _ schedule:=True, latesttime:=Range("A5") + TimeSerial(0, 0, 30) End Sub Sub RunWhat() MsgBox "The time is " & Now() End Sub Mariner wrote: I want to put various times into an excel spreadsheet, when these times are reached I need excel to display a message box with a warning and a ok button to acknowledge. Any ideas how to go about this. -- Message posted via OfficeKB.com http://www.officekb.com/Uwe/Forums.a...mming/200607/1 |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Alt + F11 opens the Visual Basic Editor.
Insert menu | Module Paste the code. Click anywhere in the setTimes code. Run with the F5 button. (When you learn more you won't have to open up the editor to run the code.) Mariner wrote: Hello I am trying to get this to work but as I am new to this, where do I put the code. Thanks Try Excel's OnTime. Here is an example to start you off. [quoted text clipped - 18 lines] reached I need excel to display a message box with a warning and a ok button to acknowledge. Any ideas how to go about this. -- Message posted via http://www.officekb.com |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thank you Skatonni this is great.
Is it possible to display say for example "message A" when the cell A4 procedure runs and a different message for example "message B" when cell A5 procedure runs. "skatonni via OfficeKB.com" wrote: Alt + F11 opens the Visual Basic Editor. Insert menu | Module Paste the code. Click anywhere in the setTimes code. Run with the F5 button. (When you learn more you won't have to open up the editor to run the code.) Mariner wrote: Hello I am trying to get this to work but as I am new to this, where do I put the code. Thanks Try Excel's OnTime. Here is an example to start you off. [quoted text clipped - 18 lines] reached I need excel to display a message box with a warning and a ok button to acknowledge. Any ideas how to go about this. -- Message posted via http://www.officekb.com |
#7
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
In the OnTime statement for A5 change RunWhat to anything else, perhaps
RunWhatA5 Application.OnTime earliesttime:=Range("A5"), procedu="RunWhatA5", _ schedule:=True, latesttime:=Range("A5") + TimeSerial(0, 0, 30) Add this third macro Sub RunWhatA5() MsgBox "message B" End Sub Mariner wrote: Thank you Skatonni this is great. Is it possible to display say for example "message A" when the cell A4 procedure runs and a different message for example "message B" when cell A5 procedure runs. Alt + F11 opens the Visual Basic Editor. Insert menu | Module [quoted text clipped - 14 lines] reached I need excel to display a message box with a warning and a ok button to acknowledge. Any ideas how to go about this. -- Message posted via OfficeKB.com http://www.officekb.com/Uwe/Forums.a...mming/200607/1 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
How to get rid of the warning message | Setting up and Configuration of Excel | |||
Fonts warning message when creating charts | Excel Discussion (Misc queries) | |||
Warning Message | Excel Worksheet Functions | |||
warning message | Excel Discussion (Misc queries) | |||
Warning message | Excel Discussion (Misc queries) |