View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Mike Mike is offline
external usenet poster
 
Posts: 3,101
Default Setting the CodeName of a new worksheet in the VBE Editor

Paul,

When the sheet is created it is the active sheet so this should be the next
line after creation.

ActiveSheet.Name = "Your Name"

Mike

"Philip" wrote:

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