Run a macro continuously

V

vernalGreens

My macro fetches data from a website. I want this macro to get the data
every 30 seconds.

So I've inserted a time delay. Here's the code.

Start = Timer ' Set start time.
Do While Timer < Start + 30
DoEvents ' Yield to other processes.
Loop


After going through this piece of code, I want to get new data from the
website. So the macro should run automatically after every 30 seconds.
How can I achieve this?
 
M

Mike Woodhouse

My macro fetches data from a website. I want this macro to get the data
every 30 seconds.

So I've inserted a time delay. Here's the code.

Start = Timer ' Set start time.
Do While Timer < Start + 30
DoEvents ' Yield to other processes.
Loop

After going through this piece of code, I want to get new data from the
website. So the macro should run automatically after every 30 seconds.
How can I achieve this?

You might want to take a look at Application.OnTime (just search the
VBA help for "OnTime").

Mike
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top