Does anyone know how I can set a macro to automaticly update with a set amount of time? Like every five minutes for example. I have the macro assigned to a button that I would like to not have to push constantly.
Well, the 2 guys replied while I was writing up a simple example so I'll post it anyway:-
If you place all of this code into a module and run the procedure 'Main', the procedure DoSomething will run every 5 minutes. Call the StopIt procedure to cancel it.
Dim dteProcTime As Date
dteProcTime = Now() + TimeValue("00:05:00")
Application.OnTime dteProcTime, "DoSomething"
Cells(1, 1) = "Hello. The current time is " & Now
Application.OnTime dteProcTime, "DoSomething", , False
Are you running the "Main" macro? It should also work if you run the DoSomething macro so I'm not sure what you're doing wrong. Just to clarify, this macro will run every 5 minutes and will put the current time in cell A1 UNTIL you run the StopIt macro.