Thread: codename help
View Single Post
  #6   Report Post  
Posted to microsoft.public.excel.programming
Bruno Campanini[_3_] Bruno Campanini[_3_] is offline
external usenet poster
 
Posts: 52
Default codename help

"Gary Keramidas" <GKeramidasATmsn.com wrote in message
...
i want to loop through 12 sheets, codename sheet1 thru sheet12

why doesn't this work?

i = 1
For i = 1 To 12
cname = "Sheet" & i
cname.Select
Next

--


Gary


This works:

---------------------------
Sub Button4_Click()
Dim i As Integer
For i = 1 To 4
Sheets("Sheet" & i).Activate
MsgBox ActiveSheet.Name
Next
End Sub
-------------------------

Ciao
Bruno