简体   繁体   中英

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

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.

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]]")

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 eg Sheet1! and $ with blank.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM