Excel tab sheet names vs. Visual Basic sheet names

In the Excel object model a Worksheet has 2 different name properties:

Worksheet.Name
Worksheet.CodeName

the Name property is read/write and contains the name that appears on the sheet tab. It is user and VBA changeable

the CodeName property is read-only

You can reference a particular sheet as
Worksheets(“Fred”).Range(“A1”) where Fred is the .Name property
or as
Sheet1.Range(“A1”) where Sheet1 is the codename of the worksheet.

Leave a Comment