ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Displaying sheet code name and sheet name (https://www.excelbanter.com/excel-programming/374659-displaying-sheet-code-name-sheet-name.html)

Barb Reinhardt

Displaying sheet code name and sheet name
 
I have changed the code name for many of the sheets in my workbook, but want
to get a listing of them. How are the code names and the sheet names coded
so that I can display them?

Thanks

Bob Phillips

Displaying sheet code name and sheet name
 
One way

Sub ListCodeNames()
Dim sh As Object
Dim oVBMod As Object
With ActiveWorkbook.VBProject
For Each oVBMod In .VBComponents
Select Case oVBMod.Type
Case 100:
Debug.Print "Name is " &
CStr(.VBComponents(oVBMod.Properties("Codename")). _
Properties("Name")) & ", CodeName is " &
CStr(.VBComponents(oVBMod.Properties("Codename")). _
Properties("CodeName"))
End Select
Next oVBMod
End With
End Sub


--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"Barb Reinhardt" wrote in message
...
I have changed the code name for many of the sheets in my workbook, but

want
to get a listing of them. How are the code names and the sheet names

coded
so that I can display them?

Thanks




Tom Ogilvy

Displaying sheet code name and sheet name
 
Sub abc()
Dim sh as Worksheet
For Each sh In ThisWorkbook.Worksheets
s = "Tab Name " & sh.Name & vbNewLine _
& "Codename: " & sh.CodeName
MsgBox s
Next

End Sub

--
Regards,
Tom Ogilvy


"Barb Reinhardt" wrote:

I have changed the code name for many of the sheets in my workbook, but want
to get a listing of them. How are the code names and the sheet names coded
so that I can display them?

Thanks



All times are GMT +1. The time now is 05:25 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com