Worksheet.Name Property (Excel)

Office 2013 and later
GitHub-Mark-64px

Contribute to this content

Use GitHub to suggest and submit changes. See our guidelines for contributing to VBA documentation.

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, MrExcel.com

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() 
    Range("D5").Select 
    Selection.Formula = "=text(now(),""mmm dd yyyy"")" 
    Selection.Copy 
    Selection.PasteSpecial Paste:=xlValues 
    Application.CutCopyMode = False 
    Selection.Columns.AutoFit 
    ActiveSheet.Name = Range("D5").Value 
    Range("D5").Value = "" 
End Sub 

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 MrExcel.com, which includes more than 300,000 questions and answers about Excel.

Show: