JenniferMurphy
Well-known Member
- Joined
- Jul 23, 2011
- Messages
- 2,540
- Office Version
- 365
- Platform
- Windows
Is there VBA code that I can use to check whether a text string, such as "Table12", is the name of a valid table in the calling sheet?
This is what I am currently doing. Is there a better way?
Thanks
This is what I am currently doing. Is there a better way?
VBA Code:
Dim loTable As ListObject
On Error GoTo BadTableName
Set loTable = Range(rnTable).ListObject
GoTo TableNameOK
BadTableName:
Call ErrMsg("Invalid table name (" & rnTable & ")", MyName)
Exit Sub
TableNameOK:
Thanks
Last edited: