Whenever I declare a variable as a ListObject and then use the SET command, it changes the data type from and object to a string. Why is this and is there a way to avoid it?
>>> use code - tags <<<
>>> use code - tags <<<
Code:
Sub SetTest()
Dim tbl As ListObject
Debug.Print "VarType BEFORE:", VarType(tbl) 'returns 9
Set tbl = ActiveSheet.ListObjects("Table1")
Debug.Print "VarType AFTER:", VarType(tbl) 'returns 8
End Sub
Last edited by a moderator: