I have the below code which works well to display each defined worksheet for 20 seconds, in a loop. I would like to be able to refresh the workbook after each loop or at a defined interval. Inserting ActiveWorkbook.RefreshAll in the code doesn't seem to work.
Any help would be hugely appreciated!
Many thanks in advance
Sub Test2()
Dim i As Long, j As Long, t As Single, str As String
Dim MyArray As Variant
MyArray = Array("Sheet1", "Sheet2", "Sheet4", "Sheet6")
For j = LBound(MyArray) To UBound(MyArray)
On Error GoTo exit_
Application.EnableCancelKey = xlErrorHandler
str = MyArray(j)
Sheets(str).Select
t = Timer + 1
Application.Wait Now + TimeSerial(0, 0, 20)
If Timer < t Then Exit Sub
If j = UBound(MyArray) Then
j = -1
Else
j = j
End If
Next j
exit_:
End Sub