返回或设置指定名称在宏语言中的分类。该名称必须针对一个自定义函数或命令。String 类型,可读写。
本示例假定已在 Microsoft Excel 4.0 宏表中创建了一个自定义函数或命令。本示例显示该名称在宏语言中的分类。假定该自定义函数或命令的名称在指定工作簿中唯一。
With ActiveWorkbook.Names(1)
If .MacroType <> xlNone Then
MsgBox "The category for this name is " & .Category
Else
MsgBox "This name does not refer to" & _
" a custom function or command."
End If
End With