Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 173
Default Run Time macro based on the value in cell

Dear Expert,
Currently, I am running a time macro ...
I have to change the time in VB script.
Is it pssible for me to set the time in cell E2 and then run the time maco
based on the value in cell E2 ? Thanks


Sub StartTimer()

CreateObject("WScript.Shell").Popup "Macro is going to run on scheduled
time.", 2, "Thank you very much for your cooperation"
RunWhen = TimeSerial(3, 30, 0)
Application.OnTime EarliestTime:=RunWhen, Procedu=cRunWhat, _
Schedule:=True
End Sub
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,565
Default Run Time macro based on the value in cell

Try this:

Sub StartTimer()

CreateObject("WScript.Shell").Popup "Macro is going to run on scheduled
time.", 2, "Thank you very much for your cooperation"
RunWhen = TimeValue(Range("A1").Value) '<<Range to use???
Application.OnTime EarliestTime:=RunWhen, Procedu=cRunWhat, _
Schedule:=True
End Sub



"Elton Law" wrote in message
...
Dear Expert,
Currently, I am running a time macro ...
I have to change the time in VB script.
Is it pssible for me to set the time in cell E2 and then run the time maco
based on the value in cell E2 ? Thanks


Sub StartTimer()

CreateObject("WScript.Shell").Popup "Macro is going to run on scheduled
time.", 2, "Thank you very much for your cooperation"
RunWhen = TimeSerial(3, 30, 0)
Application.OnTime EarliestTime:=RunWhen, Procedu=cRunWhat, _
Schedule:=True
End Sub



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 173
Default Run Time macro based on the value in cell

Hi Friend,

Error message comes on this script ....
It turns yellow ....
RunWhen = TimeValue(Range("E2").Value)
Can you help again ? Thanks
Elton


"JLGWhiz" wrote:

Try this:

Sub StartTimer()

CreateObject("WScript.Shell").Popup "Macro is going to run on scheduled
time.", 2, "Thank you very much for your cooperation"
RunWhen = TimeValue(Range("A1").Value) '<<Range to use???
Application.OnTime EarliestTime:=RunWhen, Procedu=cRunWhat, _
Schedule:=True
End Sub



"Elton Law" wrote in message
...
Dear Expert,
Currently, I am running a time macro ...
I have to change the time in VB script.
Is it pssible for me to set the time in cell E2 and then run the time maco
based on the value in cell E2 ? Thanks


Sub StartTimer()

CreateObject("WScript.Shell").Popup "Macro is going to run on scheduled
time.", 2, "Thank you very much for your cooperation"
RunWhen = TimeSerial(3, 30, 0)
Application.OnTime EarliestTime:=RunWhen, Procedu=cRunWhat, _
Schedule:=True
End Sub




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,986
Default Run Time macro based on the value in cell

Format cell E2 as text.
Sub test()
Range("E2").NumberFormat = "@"
CreateObject("WScript.Shell").Popup "Macro is going to run on scheduled
time.", 2, "Thank you very much for your cooperation"
RunWhen = TimeValue(Range("A1").Value) '<<Range to use???
Application.OnTime EarliestTime:=RunWhen, Procedu=cRunWhat, _
Schedule:=True
End Sub




"Elton Law" wrote:

Hi Friend,

Error message comes on this script ....
It turns yellow ....
RunWhen = TimeValue(Range("E2").Value)
Can you help again ? Thanks
Elton


"JLGWhiz" wrote:

Try this:

Sub StartTimer()

CreateObject("WScript.Shell").Popup "Macro is going to run on scheduled
time.", 2, "Thank you very much for your cooperation"
RunWhen = TimeValue(Range("A1").Value) '<<Range to use???
Application.OnTime EarliestTime:=RunWhen, Procedu=cRunWhat, _
Schedule:=True
End Sub



"Elton Law" wrote in message
...
Dear Expert,
Currently, I am running a time macro ...
I have to change the time in VB script.
Is it pssible for me to set the time in cell E2 and then run the time maco
based on the value in cell E2 ? Thanks


Sub StartTimer()

CreateObject("WScript.Shell").Popup "Macro is going to run on scheduled
time.", 2, "Thank you very much for your cooperation"
RunWhen = TimeSerial(3, 30, 0)
Application.OnTime EarliestTime:=RunWhen, Procedu=cRunWhat, _
Schedule:=True
End Sub




  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 173
Default Run Time macro based on the value in cell

Wonderful !!!! Make it ... Thanks so much !

"JLGWhiz" wrote:

Format cell E2 as text.
Sub test()
Range("E2").NumberFormat = "@"
CreateObject("WScript.Shell").Popup "Macro is going to run on scheduled
time.", 2, "Thank you very much for your cooperation"
RunWhen = TimeValue(Range("A1").Value) '<<Range to use???
Application.OnTime EarliestTime:=RunWhen, Procedu=cRunWhat, _
Schedule:=True
End Sub




"Elton Law" wrote:

Hi Friend,

Error message comes on this script ....
It turns yellow ....
RunWhen = TimeValue(Range("E2").Value)
Can you help again ? Thanks
Elton


"JLGWhiz" wrote:

Try this:

Sub StartTimer()

CreateObject("WScript.Shell").Popup "Macro is going to run on scheduled
time.", 2, "Thank you very much for your cooperation"
RunWhen = TimeValue(Range("A1").Value) '<<Range to use???
Application.OnTime EarliestTime:=RunWhen, Procedu=cRunWhat, _
Schedule:=True
End Sub



"Elton Law" wrote in message
...
Dear Expert,
Currently, I am running a time macro ...
I have to change the time in VB script.
Is it pssible for me to set the time in cell E2 and then run the time maco
based on the value in cell E2 ? Thanks


Sub StartTimer()

CreateObject("WScript.Shell").Popup "Macro is going to run on scheduled
time.", 2, "Thank you very much for your cooperation"
RunWhen = TimeSerial(3, 30, 0)
Application.OnTime EarliestTime:=RunWhen, Procedu=cRunWhat, _
Schedule:=True
End Sub



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
Running a macro based on the time WNYC Excel Discussion (Misc queries) 1 March 22nd 10 09:45 PM
Run Macro Based On Time Sabosis Excel Worksheet Functions 2 October 16th 08 09:31 PM
Run macro based on time Bruce Excel Worksheet Functions 7 December 23rd 05 01:27 PM
Time based macro Dave Peterson[_3_] Excel Programming 0 July 9th 03 04:00 AM
Time based macro Jan[_6_] Excel Programming 0 July 8th 03 02:31 PM


All times are GMT +1. The time now is 06:08 AM.

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"