Hello webtubbs,
Codename is automatically set by Excel to names like "Sheet1", "Sheet2", "Sheet3" etc. If you delete one of these three sheets (or rename them), the next worksheet you insert will still be named "Sheet4". Therefore, I presume that the workbook has a counter somewhere which must be static.
Now, when I create a new worksheet I can take the number from the Codename. But where does the CodeName get it from? That must be the source.
Regards,
awink





by: webtubbsPosted on 2009-10-17 at 21:05:01ID: 25598656
1. There is no direct way to determine the name of the Template used to create the workbook.
2. CodeName returns a String (not number), which is the name used in VBA only, and cannot be readily changed with the usual methods.
>>but I would prefer to take it from its source.
What source?