wastewaterguy
New Member
- Joined
- Jan 12, 2023
- Messages
- 1
- Office Version
- 2016
- Platform
- Windows
I am not super well versed in VBA but pretty good with excel. I need to run some simple code to keep a sheet refreshing every so often, but it would refresh all open sheets which I do not want. I attempted to restrict it to a single sheet which works great until i open a second excel sheet. can someone help me out with this?> I greatly appreciate!
Sub Autpen()
Workbooks("RefreshTest.xlsm").RefreshAll
Application.OnTime Now + TimeValue("00:00:01"), "OpenMe"
Workbooks("RefreshTest.xlsm").Close False
End Sub
Sub OpenMe()
Application.OnTime Now + TimeValue("00:00:30"), "Autpen"
End Sub
Sub Autpen()
Workbooks("RefreshTest.xlsm").RefreshAll
Application.OnTime Now + TimeValue("00:00:01"), "OpenMe"
Workbooks("RefreshTest.xlsm").Close False
End Sub
Sub OpenMe()
Application.OnTime Now + TimeValue("00:00:30"), "Autpen"
End Sub