Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 47
Default Run Macro Based On Time

Hello-

I have a workbook that send out department stats out every hour to our
management team. I need to add something (might be an IF statement) to
run a seperate code if two conditions exist:

The computer time is 9:05

The value of cell a6 is <0.03

If those conditions exist I would need to call a macro named
SendStats3, a special macro that will alert our department admin via
email that we need additional reporting done.

I looked into the Application.ontime function but could not see how to
apply it. Also, does it matter what the "seconds" are on the computer
time? I did not want the computer time to need to be exact down to the
second, just as long as the clock on the PC says 9:05.

Thanks in advance for any help that you might offer up.

Scott
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,344
Default Run Macro Based On Time

Hi,

You need the OnTime command, since you didn't show us your current code you
would need something like this:

This example runs my_Procedure at 5 P.M.

Application.OnTime TimeValue("17:00:00"), "my_Procedure"

within the sub my_procedure you would have your other condition.


--
Thanks,
Shane Devenshire


"Sabosis" wrote:

Hello-

I have a workbook that send out department stats out every hour to our
management team. I need to add something (might be an IF statement) to
run a seperate code if two conditions exist:

The computer time is 9:05

The value of cell a6 is <0.03

If those conditions exist I would need to call a macro named
SendStats3, a special macro that will alert our department admin via
email that we need additional reporting done.

I looked into the Application.ontime function but could not see how to
apply it. Also, does it matter what the "seconds" are on the computer
time? I did not want the computer time to need to be exact down to the
second, just as long as the clock on the PC says 9:05.

Thanks in advance for any help that you might offer up.

Scott

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 47
Default Run Macro Based On Time

On Oct 15, 9:14*pm, ShaneDevenshire
wrote:
Hi,

You need the OnTime command, since you didn't show us your current code you
would need something like this:

This example runs my_Procedure at 5 P.M.

Application.OnTime TimeValue("17:00:00"), "my_Procedure"

within the sub my_procedure you would have your other condition.

--
Thanks,
Shane Devenshire



"Sabosis" wrote:
Hello-


I have a workbook that send out department stats out every hour to our
management team. I need to add something (might be an IF statement) to
run a seperate code if two conditions exist:


The computer time is 9:05


The value of cell a6 is <0.03


If those conditions exist I would need to call a macro named
SendStats3, a special macro that will alert our department admin via
email that we need additional reporting done.


I looked into the Application.ontime function but could not see how to
apply it. Also, does it matter what the "seconds" are on the computer
time? I did not want the computer time to need to be exact down to the
second, just as long as the clock on the PC says 9:05.


Thanks in advance for any help that you might offer up.


Scott- Hide quoted text -


- Show quoted text -


What if the time was not exactly at 5:00? My code starts running at
9:05 in the morning, but there is a lot of formatting that takes place
prior to getting to the point where the workbook is emailed out. Does
the Application.Ontime code need to be specific down to the seconds?
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
Time - Analysis based on time bluesifi Excel Discussion (Misc queries) 6 June 13th 08 03:19 PM
Calculate Date based on Time Mayte Excel Worksheet Functions 6 June 5th 08 09:07 PM
Trying to take sample readings based on time [email protected] Excel Discussion (Misc queries) 0 November 21st 07 05:43 PM
Run macro based on time Bruce Excel Worksheet Functions 7 December 23rd 05 01:27 PM
change date based on time kdp145 Excel Discussion (Misc queries) 7 December 14th 05 02:05 AM


All times are GMT +1. The time now is 12:14 AM.

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

About Us

"It's about Microsoft Excel"