Home » excel » How do you convert a structured reference in excel to a range?

How do you convert a structured reference in excel to a range?

Posted by: admin May 14, 2020 Leave a comment

Questions:

I have a table with columns that have headers. I’d like to be able to convert the structured reference [Column 2] to the range B1:B1000 and Table1[[#Data],[Column2]] to the range B2:B1000.

edit for context:

This is in the formula editor so the structured references refer to a table in the current worksheet.

How to&Answers:

This will give you the address:

Activesheet.Range("Table1[[#Data],[Column2]]").Address()

This would give you a reference to the range itself

Dim rng As Range
Set rng = Activesheet.Range("Table1[[#Data],[Column2]]")

Answer:

In the Table options you can select the option Convert to Range which will change structured references in formulas to range references, you can then choose Insert Table to reinstate the table. To simplify formulas you could use find & replace e.g. Sheet1! and $ with blank.