Create a named structure reference

I've run into a problem where I would like to learn how to create a structure name to reference headers in a table:
To reference the headers =Source_Data[#Headers]

I'm can't seem to connect the dots.
Frank FreeseAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Jan Karel PieterseExcel and VBA ExpertCommented:
I'm not sure in what context, in a formula, in VBA, ...?
Check out if it is VBA syntax you are looking for.
Frank FreeseAuthor Commented:
I've been trying to edit the question as follows:

=INDEX(Source_Data[[#Headers],[Spend $]:[Cost / Sale]],,selection)

and I keep getting #NAME!
Glenn RayExcel VBA DeveloperCommented:
Using a structrured reference on the table headers like:
yields an array, so it's not a displayable value.

However, if you were using this in an indexing or array function - or wanted to create a dynamic range name, it's perfectly usable.  For example, the name of the third header lable in your table would be:

Bootstrap 4: Exploring New Features

Learn how to use and navigate the new features included in Bootstrap 4, the most popular HTML, CSS, and JavaScript framework for developing responsive, mobile-first websites.

Glenn RayExcel VBA DeveloperCommented:
We cross-posted!  Looking at your follow-up, are you trying to do this in VBA?  "selection" makes me think so.

If so, are you trying to enter a formula in a cell with this reference or are you trying to determine the header lable based on the active cell's column on the sheet?

Frank FreeseAuthor Commented:
One additional question please
[#Headers] is a predefined range and one does not have to define it in Name Manager?
Frank FreeseAuthor Commented:
Actually, "selection" is a named range.
Glenn RayExcel VBA DeveloperCommented:
[#Headers] alone is not a defined range, but used with the Excel Table identifier, it can be.  And it's dynamic; will change as the table layout changes.

if "selection" is a named range, the only issue would be if the value is greater than 2 (only two columns referenced) or less than 1.



Resources (Microsoft)
Using structured references with Excel tables
Use structured references in Excel table formulas

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Frank FreeseAuthor Commented:
"selection" is a cell reference (I'm not having a very good Sunday)
Thanks I'm clearer now and appreciate everyone's help!
Frank FreeseAuthor Commented:
thank you kindly
Glenn RayExcel VBA DeveloperCommented:
You're welcome.  The links I posted are very helpful (for me, at least).

Frank FreeseAuthor Commented:
Those will be read!
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Excel

From novice to tech pro — start learning today.