Get a column index from a column index or name
- if the passed value is an integer, it is treated as a column index
- if the passed value is a string and ColInterpretation=xf_ColInterpretation_FirstAsName, it is treated as a column name always (even if it is numeric)
- if the passed value is a string and ColInterpretation=xf_ColInterpretation_FirstAsIndex , the value is treated as a column index if the string can be converted to an integer, or as a column name otherwise
The column index (1 ... ColCount) or name. An integer will always be treated as a column index. A string which can be converted to an integer may be treated as a column index, depending on the value of ColInterpretation.
Do not display an error message if the row or column index are out of range, just return Null.
if xf_ColInterpretation_FirstAsIndex, interpret ColNameOrIntIndex as an index if it can be converted to an integer, even if it is passed as a string if xf_ColInterpretation_FirstAsName, always interpret ColNameOrIntIndex as name if it is a passed as a string
Debug.Print lst.GetColIndexFromColNameOrIndex(4) -> 4
Debug.Print lst.GetColIndexFromColNameOrIndex("CategoryID") -> 2