Application.Wait & If Not Intersect Problems

craignet

New Member
Joined
Aug 4, 2012
Messages
11
Hi,

I have a workbook which copys data from a web data connection.

The problem I'm having is the website updates each minute, with various amount of data, until an upload is complete (this can take a while sometimes), and I don't want the macro to continue until all data is uploaded.

So I thought the 'If Not Intersect' command would do the trick. I would get the 'If Not Intersect' command to see if any data has changed in a certain range, if not then continue as this means the data connection is has finished updating, if it has changed then wait 2 minutes via the Application.Wait command, go back and try again, and do this until no data has changed and the data connection has finished updating.

Below code is what I have so far but it doesn't seem to be working, I think it might be something to do with the 'Startagain' command.

Any advise would be greatly appriciated.
Code:
 Application.Wait (Now + TimeValue("00:02:00"))
Startagain:
If Not Intersect(Target, Columns("B3:D3000")) Is Nothing Then
    Application.Wait (Now + TimeValue("00:02:00"))
    GoTo Startagain
    Else
 

Excel Facts

Select a hidden cell
Somehide hide payroll data in column G? Press F5. Type G1. Enter. Look in formula bar while you arrow down through G.

Forum statistics

Threads
1,216,458
Messages
6,130,757
Members
449,588
Latest member
accountant606

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top