I have a API datasource that updates continuously. Instead of having to press Refresh All constantly, I found this VBA code:
This refreshes the data every minute.
How do I change this to be able to start/stop the refresh? I.e. when I press the button it should start or stop refreshing the data every minute.
Thanks.
VBA Code:
Sub AutoRefresh()
ActiveWorkbook.RefreshAll
'Auto-Refresh in 0 hours, 1 minute, 0 seconds
NextTime = Time + TimeSerial(0, 1, 0)
Application.OnTime NextTime, "AutoRefresh"
End Sub
This refreshes the data every minute.
How do I change this to be able to start/stop the refresh? I.e. when I press the button it should start or stop refreshing the data every minute.
Thanks.