return sheets code name

  • Thread starter Thread starter Karen53
  • Start date Start date
K

Karen53

or something similarHi,

Is there a way to return the code name of a worksheet using sheets(ShName)?
 
I re read you question and thought perhaps this is what you want.

Sheets("My sheet").CodeName
 
Yes, thank you OssieMac. The second answer is what I was looking for.
 
In addition to OssieMac's code.

Sub CreateListOfSheetsOnFirstSheet()
Dim ws As Worksheet
For I = 1 To Worksheets.Count
With Worksheets(1)
Set ws = Worksheets(I)
.Cells(I, 1).Value = ws.Name
.Cells(I, 2).Value = ws.CodeName
End With
Next I
End Sub


Gord Dibben MS Excel MVP
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Need to loop 4
Reference sheets named by DAY 7
Custom Header 1
"Sort key" problem now is "worksheet identification" 1
Catch error 4
Borders Error 10
Copy method of Worksheet class failed 4
Expert eye needed 4

Back
Top