Muokkaa

Jaa


Style.Name property (Excel)

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.

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.

 
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

Support and feedback

Have questions or feedback about Office VBA or this documentation? Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.