Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
code for program run once everyday
What is the code if I want it runs only once per day?
|
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
code for program run once everyday
If you mean set a macro to run at a scheduled time then see
http://www.cpearson.com/excel/ontime.htm otherwise if you mean only allow a macro to be run only once per day then you could have a hidden sheet (Sheet1 in my example) with a date in cell A1. Then you could code your macro like this: Sub RunIt() If Sheets("Sheet1").Range("A1").Value = Date Then MsgBox "Macro has been run already today.", vbExclamation Else Sheets("Sheet1").Range("A1").Value = Date 'rest of code here End If End Sub This checks the date on the hidden sheet and if it is not the current date it sets it to today and then runs rest of code. If the date on the sheet is already today then it gives a message saying the macro has already been run. Hope this helps Rowan "Angus" wrote: What is the code if I want it runs only once per day? |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
code for program run once everyday
Application.OnTime "08:00","MyProc"
read HELP for more "Angus" wrote: What is the code if I want it runs only once per day? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
automatically run a macro everyday | Excel Discussion (Misc queries) | |||
Auditing excel for everyday tasks | Excel Worksheet Functions | |||
Add code to a excel's form created by program (Vb .Net) | New Users to Excel | |||
[HELP] closing a program with VBA code | Excel Programming | |||
Searching for VB Code to Link to Program | Excel Programming |