Thread: codename help
View Single Post
  #12   Report Post  
Posted to microsoft.public.excel.programming
Chip Pearson Chip Pearson is offline
external usenet poster
 
Posts: 7,247
Default codename help

If you really need the CodeName, not the Sheet name, try
something like

Dim N As Integer
For N = 1 To 3
Debug.Print ThisWorkbook.VBProject.VBComponents("Sheet" &
N).Name
Next N




"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