Thread: Codenames
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Jim Rech Jim Rech is offline
external usenet poster
 
Posts: 2,718
Default Codenames

A sheet module does not exist until it 'appears' in the VBE.

So, run this code with the VBE open and you get a name:

Sub a()
Dim sname, coden
Worksheets.Add
sname = ActiveSheet.Name
coden = Sheets(sname).CodeName
MsgBox coden
End Sub

But run it with the VBE closed and you do not.

--
Jim
"Bill" wrote in message
link.net...
| Hello,
| I am trying to use codenames of sheets to track sheet name changes. But
| occassionally, I get nothing for a code. For example,
|
| sname = activesheet.name
| coden = sheets(sname).codename
|
| coden comes up with nothing. What can cause that?
|
| Thanks,
|
| Bill
|
|