There's a bug in the way that the codename works.
If you open the VBE after you change the codename (or insert the sheet), that's
enough to "set" the code name.
Here's a discussion that you may want to read:
http://groups.google.co.uk/group/mic...e0751c3d600448
or
http://snipurl.com/1yxzp
RV wrote:
>
> Hi,
>
> I using the worksheet code obtained using CodeName property of the
> worksheet object. Before saving the workbook, I just reshuffled the
> worksheets in the workbook by moving them. Now if I just reopen this saved
> workbook, to my surprise I found that the code name returned using
> the CodeName property on worksheet object is different from that used to
> returned when the workbook was opened first time.
>
> I have found on other sites that CodeName for worksheet never changes.
>
> Can anyone please clear my concept on the CodeName?
>
> Thanks and With Warm Regads,
>
> -Rahul Vakil
--
Dave Peterson