ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   timer within a macro (https://www.excelbanter.com/excel-programming/276139-re-timer-within-macro.html)

Orlando Magalhães Filho

timer within a macro
 
Hi Jonathan,

I think you have to use ON.TIME function. See this link of Chip Pearson

http://www.cpearson.com/excel/ontime.htm

HTH

--
(So that you get best and rapid solution and all may benefit from the
discussion, please reply within the newsgroup, not in email)




"Jonathan" escreveu na mensagem
...
if I have a macro that opens a file and then another two
perform a function once a condition is met how do I do
it?

When the first macro runs it updates (via a dde link) and
takes a while to update. when fully updated a check cell
changes from value 0 to 1. When it turns to 1 I want the
second macro to run. any way to do this? Perhaps a loop
that keeps checking the status of the check cell?




Tom Ogilvy

timer within a macro
 
SetLinkOnData can be used to trigger a macro when a DDE link changes.

Ontime, as Orlando has said, is used to run a macro after a set amount of
time has elapsed.

It sounds like Ontime has a role to play, but your challenge appears to be
initiating the ontime setting.

--
Regards,
Tom Ogilvy

"Jonathan" wrote in message
...
thanks, but I don't think that is what I am looking for.

Was more looking for some type of code that said if a
cell does not equal a certain value, wait ten seconds, if
it does then run another macro.


-----Original Message-----
Hi Jonathan,

I think you have to use ON.TIME function. See this link

of Chip Pearson

http://www.cpearson.com/excel/ontime.htm

HTH

--
(So that you get best and rapid solution and all may

benefit from the
discussion, please reply within the newsgroup, not in

email)




"Jonathan" escreveu na mensagem
...
if I have a macro that opens a file and then another

two
perform a function once a condition is met how do I do
it?

When the first macro runs it updates (via a dde link)

and
takes a while to update. when fully updated a check

cell
changes from value 0 to 1. When it turns to 1 I want

the
second macro to run. any way to do this? Perhaps a

loop
that keeps checking the status of the check cell?



.




Jonathan[_5_]

timer within a macro
 
the real issue I am facing is how to trigger the macro to
run WHEN a condition in a cell is met.
-----Original Message-----
SetLinkOnData can be used to trigger a macro when a DDE

link changes.

Ontime, as Orlando has said, is used to run a macro

after a set amount of
time has elapsed.

It sounds like Ontime has a role to play, but your

challenge appears to be
initiating the ontime setting.

--
Regards,
Tom Ogilvy

"Jonathan" wrote in message
...
thanks, but I don't think that is what I am looking

for.

Was more looking for some type of code that said if a
cell does not equal a certain value, wait ten seconds,

if
it does then run another macro.


-----Original Message-----
Hi Jonathan,

I think you have to use ON.TIME function. See this

link
of Chip Pearson

http://www.cpearson.com/excel/ontime.htm

HTH

--
(So that you get best and rapid solution and all may

benefit from the
discussion, please reply within the newsgroup, not in

email)




"Jonathan" escreveu na mensagem
...
if I have a macro that opens a file and then another

two
perform a function once a condition is met how do I

do
it?

When the first macro runs it updates (via a dde

link)
and
takes a while to update. when fully updated a check

cell
changes from value 0 to 1. When it turns to 1 I want

the
second macro to run. any way to do this? Perhaps a

loop
that keeps checking the status of the check cell?


.



.


Jonathan[_5_]

timer within a macro
 
Thanks for all your help, however still not working.

The calculate event is for when data changes in a chart
accordign to my book. Not sure what you mean. I tried
doing an infinite loop until the condition was met but it
put the DDE updating on hold so didnt woark.

In summary, this is what I am trying to do:

a spreadsheet opens, DDE links start updating. I have a
cell that turns to "1" if the calculations are complete
and no errors and "0" if stillupdating or complete (i.e.,
fully updated) but with errors.

Once this turns to "1" I want to start another macro. I
actually have a macro from another file that opens the
file in question. what I would like to do is append to
that macro a mechanism to start the other macro once
the "1" condition is met.

Any additional help would be greatly appreciated. Thanks
again./Jonathan





-----Original Message-----
use the calculate event and test for the condition.

Regards,
Tom Ogilvy


Jonathan wrote in message
...
the real issue I am facing is how to trigger the macro

to
run WHEN a condition in a cell is met.
-----Original Message-----
SetLinkOnData can be used to trigger a macro when a

DDE
link changes.

Ontime, as Orlando has said, is used to run a macro

after a set amount of
time has elapsed.

It sounds like Ontime has a role to play, but your

challenge appears to be
initiating the ontime setting.

--
Regards,
Tom Ogilvy

"Jonathan" wrote in message
...
thanks, but I don't think that is what I am looking

for.

Was more looking for some type of code that said if

a
cell does not equal a certain value, wait ten

seconds,
if
it does then run another macro.


-----Original Message-----
Hi Jonathan,

I think you have to use ON.TIME function. See this

link
of Chip Pearson

http://www.cpearson.com/excel/ontime.htm

HTH

--
(So that you get best and rapid solution and all

may
benefit from the
discussion, please reply within the newsgroup, not

in
email)




"Jonathan" escreveu na mensagem
...
if I have a macro that opens a file and then

another
two
perform a function once a condition is met how

do I
do
it?

When the first macro runs it updates (via a dde

link)
and
takes a while to update. when fully updated a

check
cell
changes from value 0 to 1. When it turns to 1 I

want
the
second macro to run. any way to do this?

Perhaps a
loop
that keeps checking the status of the check cell?


.



.



.



All times are GMT +1. The time now is 05:41 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com