agnesz
09-11-2008, 12:55 PM
I am currently using the following code to loop through all worksheets, however I'd like to adjust it to only loop through the visible ones.
Any thoughts?
Sub WorksheetLoop()
Dim WS_Count As Integer
Dim I As Integer
' Set WS_Count equal to the number of worksheets in the active
' workbook.
WS_Count = ActiveWorkbook.Worksheets.Count
' Begin the loop.
For I = 1 To WS_Count
ActiveWorkbook.Worksheets(I).Activate
looppoop
' The following line shows how to reference a sheet within
' the loop by displaying the worksheet name in a dialog box.
Next I
End Sub
Any thoughts?
Sub WorksheetLoop()
Dim WS_Count As Integer
Dim I As Integer
' Set WS_Count equal to the number of worksheets in the active
' workbook.
WS_Count = ActiveWorkbook.Worksheets.Count
' Begin the loop.
For I = 1 To WS_Count
ActiveWorkbook.Worksheets(I).Activate
looppoop
' The following line shows how to reference a sheet within
' the loop by displaying the worksheet name in a dialog box.
Next I
End Sub