I have master sheet in which data from various "options" sheets pulled now I want to refresh all "options" sheets to get refresh on specific interval for that I have following vba code in master sheet
Public interval As Double
Sub Dosomething()
Dim xSh As Worksheet
Application.ScreenUpdating = False
For Each xSh In Worksheets
xSh.Select
Call macro_timer
Next
Application.ScreenUpdating = True
End Sub
Sub macro_timer()
interval = Now + TimeValue("00:03:00")
Application.OnTime interval, "my_macro"
End Sub
Sub my_macro()
For Each wb In Application.Workbooks: wb.RefreshAll: Next wb
Call macro_timer
End Sub
However code is not working as I wanted somewhere I am lacking, don't know where. pls help.thx