Share via


Style.Name Property

Excel Developer Reference

Returns a String value that represents the name of the object.

Syntax

expression.Name

expression   A variable that represents a Style object.

Example

This example displays the name of style one in the active workbook, first in the language of the macro and then in the language of the user.

Visual Basic for Applications
  With ActiveWorkbook.Styles(1)
    MsgBox "The name of the style: " & .Name
    MsgBox "The localized name of the style: " & .NameLocal
End With

The following example displays the name of the default ListObject object in sheet1 of the active workbook.

Visual Basic for Applications
     
Sub Test  
 Dim wrksht As Worksheet
   Dim oListObj As ListObject
   
   Set wrksht = ActiveWorkbook.Worksheets("Sheet1")
   Set oListObj = wrksht.ListObjects(1)
   
   MsgBox oListObj.Name  
End Sub 

See Also