View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Don Guillett Don Guillett is offline
external usenet poster
 
Posts: 10,124
Default Selecting different Worksheets from a Loop

Does this help?

Sub dosheets()
For i = 1 To Worksheets.Count
Sheets(i).Select
MsgBox ActiveSheet.Name
Next i
End Sub

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"ironhydroxide" wrote in message
...
I am trying to select worksheets within a Loop function where the worksheet
changes every time. I thought one could use a String in place of the
Worksheets("worksheet name")
But apparently i am wrong because i get a Run-time error '9' Subscript out
of range (which i think means, there is no worksheet with that name)

Thanks for any and all replies

Ironhydroxide