I am trying to convert a recorded macro to a generic VBA script (my first). The recorded macro created specific names in code like Sheet8 and Table5. I need them to be defined dynamically in the code, and so far I could figure it out ...
'This table name needs to be dynamically determined...
Dim myTable As ListObject
Set myTable = ActiveSheet.ListObjects.Add(xlSrcRange, myRng, , xlNo)
However, I need help on how to convert these strings ...
Range("Table5[[#Headers],[Column1]]").Select
... to what uses myTable ListObject.
Any ideas? Thank!
source
share