Notifications
Clear all
VBA & Macros
2
Posts
2
Users
0
Reactions
109
Views
Topic starter
Could someone help me out with VBA code to automatically refresh a query (named "Times") every 30 seconds? I can set it it for one minute but would like the refresh to occur automatically every 30 seconds instead.
On a similar note, I would also like to refresh a query (named "Dates") on a different sheet upon sheet activation. Again, I cannot figure out the VBA code.
Posted : 16/03/2022 9:40 am
Use Now() + TimeSerial(0,0,30) to add 30 seconds to the current time.
For a different sheet query, use:
ThisWorkbook.Worksheets("AnotherSheetName").ListObjects("Dates").QueryTable.Refresh BackgroundQuery:=False
Posted : 18/03/2022 2:33 am