Worksheets.Add
With ActiveSheet
.Parent.VBProject.VBComponents(.CodeName) _
.Properties("_CodeName") = "wsNewSheet"
End With
--
HTH
Bob
(there's no email, no snail mail, but somewhere should be gmail in my addy)
"Philip" wrote in message
...
Hi,
When I programatically add a new worksheet in VBA, is there a way to
programatically set the CodeName property ...
So instead of showing as Sheet1 in the VB Editor 'Project Explorer', the
new
sheet shows as what I want it to be.
This is for Excel 2003
thanks for any help
Philip