• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

refresh worksheet code for a VBA loop

DAGUET

Member
Dear VBA Experts
I want to insert a refresh worksheet instruction between two loops (see att) reason is I want to avoid the last data being downloaded to refresh the prior one as well...
Do you have any idea what code line I should insert and where?
Thanks and Best Regards
 

Attachments

  • Historical Institutional Ownership with Turnover_VBA.xlsm
    74.9 KB · Views: 4
DAGUET
It's me ... again.
You wrote today that this ... same looking thread is duplicated:
which You have added already here
Is this someway different than above thread?
 
Hi

I am not sure what it is you want, as its not clear in your post. You could try something like this

This code waits 10 seconds you could change it to ("0:15:00")) to wait 15mins
Code:
Application.Wait(Now + TimeValue("0:00:10"))

OR this

Code:
If Application.Wait(Now + TimeValue("0:00:10")) Then
 MsgBox "Please click Refresh Button for latest update"
End If

This code waits 10 seconds and then a message box pops up. You can change the time to wait.

For both codes - If you place either code BEFORE Next i in you code the NEXT loop will not take place until the time has run out. If you place either code AFTER the Next i in your code then you code will keep looping until the wait time has been reached and then stop for the allotted time and then restart the loops.

For the second code, the message box will most likley need to be cleared before the code restarts.

Not sure if this is what you are after

YOU ONLY NEED ONE NOT BOTH, if this is what you are after
 
Back
Top