Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

How to get the listobject column number that matches the listcolumn name

I use the following and it returns the column of the worksheet instead of the column number of the table/list object:

InputTable.ListColumns(strDate).Range.Column

InputTable is a listobject

Currently it is returning 10 (Worksheet column number) when it should be returning 8 (ListColumns number)

Question:
how do I change my reference to return the table column instead of the worksheet column

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

ListColumns(strDate).Index is the column position within the list

See: https://learn.microsoft.com/en-us/office/vba/api/excel.listcolumn.index

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading