View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Mike Fogleman Mike Fogleman is offline
external usenet poster
 
Posts: 1,092
Default Loop thru some worksheets

I want to loop through Sheet4 to Sheet7 and do some things. There are 8
sheets total. These sheets have names, but do not want to use names if I
don't have to. The tab order is the same as the sheet index in the project
tree. So Sheet4 is the 4th sheet tab in the workbook, and so on. I can't
seem to nail this loop. Here is what I want, but doesn't work:

Sub GetTechs()
Dim i As Integer
Dim ws As Worksheet

For i = 4 To 7
ws(i).Activate
Next i
End Sub

As always, thanks for all you do here.
Mike F