I am looking to identify sheet templates by giving them a sheet level name.
If the sheet name contains a string, then I get "="string"" as the name value, not "string".
example code
If the sheet name contains a string, then I get "="string"" as the name value, not "string".
example code
Code:
Sub TestSheetName()
Dim SheetType As String
Dim Wksht As Worksheet
Set Wksht = ActiveSheet
SheetType = "SheetType1"
Wksht.Names.Add Name:="SheetType", RefersTo:=SheetType
MsgBox "The Sheet Name is " & Wksht.Names("SheetType").Value
End Sub