TheBlueMusketeer
New Member
- Joined
- Sep 29, 2012
- Messages
- 12
Hello,
Any ideas on how to capture the name of a table in a variable?
To add a table, we use the following code (recorded it) :
ActiveSheet.ListObjects.Add(xlSrcRange, Range("$D$4:$J$16"), , xlNo).Name = "Table1"
I need to refer to a table from a sheet that gets updated periodically but sometimes the same table download ends with a different number - "Table2" for example, and my vlookup formula breaks. Therefore I want to use a variable that stores the table name from this particular sheet every time the macro is run.
Thanks,
TBM
Excel 2007
Any ideas on how to capture the name of a table in a variable?
To add a table, we use the following code (recorded it) :
ActiveSheet.ListObjects.Add(xlSrcRange, Range("$D$4:$J$16"), , xlNo).Name = "Table1"
I need to refer to a table from a sheet that gets updated periodically but sometimes the same table download ends with a different number - "Table2" for example, and my vlookup formula breaks. Therefore I want to use a variable that stores the table name from this particular sheet every time the macro is run.
Thanks,
TBM
Excel 2007