Worksheet.Name Property (Excel)

Returns or sets a String value that represents the object name.


expression. Name

expression A variable that represents a Worksheet object.


Sample code provided by: Bill Jelen,

The following code example sets the name of the active worksheet equal to today's date.

' This macro sets today's date as the name for the current sheet 
Sub NameWorksheetByDate() 
    Selection.Formula = "=text(now(),""mmm dd yyyy"")" 
    Selection.PasteSpecial Paste:=xlValues 
    Application.CutCopyMode = False 
    ActiveSheet.Name = Range("D5").Value 
    Range("D5").Value = "" 
End Sub

About the Contributor

MVP Bill Jelen is the author of more than two dozen books about Microsoft Excel. He is a regular guest on TechTV with Leo Laporte and is the host of, which includes more than 300,000 questions and answers about Excel.

See also

Worksheet Object