Cnvert ColumnName to ColumnNumber

Hi all,

Column name “A” is given

How to get the column Number from it

column Number would be 1

Got a function in vba “Columns(“A”).Column” how to use it

Thanks and Regards,

Hi @supu123

Please give a try,

Dt - your datatable


Index will start with 0 , add +1 if yoo want to start with 1.


Hi @prasath_S

The output is -1 for A

Thanks and Regards,

For B also this is -1

@supu123 is the column names present in the datatable,it seems it is not there.

Also try this,this will convert excel column letter to index datatable is not required



This works

Thankyou for help

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.