cmoore3984
01-24-2011, 01:49 PM
I am trying to refresh all tabs in my workbook starting with the first sheet. There are 6 sheets, but it stops at sheet 4. I even put in a msgbox to make sure the count showed 6. Can someone look at the below vba and tell me why it would not go to the end of the workbook.
Sub RefreshTabs()
'
' RefreshTabs Macro
' Refresh all tabs with F9
' Keyboard Shortcut: Ctrl+q
Dim C As Integer
Dim i As Integer
C = Worksheets.Count
i = 1
MsgBox C
Sheets(1).Select
Calculate
For i = 1 To C
ActiveSheet.Select
ActiveSheet.Next.Select
Calculate
i = i + 1
Next
End Sub
Sub RefreshTabs()
'
' RefreshTabs Macro
' Refresh all tabs with F9
' Keyboard Shortcut: Ctrl+q
Dim C As Integer
Dim i As Integer
C = Worksheets.Count
i = 1
MsgBox C
Sheets(1).Select
Calculate
For i = 1 To C
ActiveSheet.Select
ActiveSheet.Next.Select
Calculate
i = i + 1
Next
End Sub