Getting column index from Excel

Hey guys! Me again :sob:

I want to get the column index/letter for column named “Group” from an excel file.

The column can move a lot, but all I want is the column index/letter (e.g. A, J AB, C, D) that corresponds to it

Can anyone help?

2 Likes

@Suzana_Joby Please follow How to get column index? - #7 by Vijay_Tulsalkar

1 Like

@Suzana_Joby
use this dt.Columns.IndexOf(“Group”).ToString

1 Like

@Arpit_Kesharwani @Lakshay_Verma

Thanks guys!
So this will give me number (index)

How did I then convert this to letter (to match column letter in excel)?

Hi @Suzana_Joby

Here is an activity called "Get column index " by column. It may help you.

Thank you
Balamurugan.S

1 Like

@Suzana_Joby Please follow
Convert.ToChar(yourdatatablename.Columns.Indexof(columnindex)+65).ToString

3 Likes

@Suzana_Joby
retrival / index calculation can be done with different approaches. Just let us know some more details (datasample, did you readin into datable…)

the translation of an integer index to the EXCEL column letter is best done with following:

1 Like

Sequence.xaml (7.9 KB)

This will help you understand
Reference from Stack

This didn’t work

For column index 1, it returned ‘@’
For column index 9, it returned ‘9’

Hi @Suzana_Joby,
Check this one…

Suzana_Joby.zip (22.4 KB)

Regards
Balamurugan.S

kindly note: Suzana_Joby post the question and she does need the support

@Suzana_Joby did you tried workflow which i have sahred

1 Like

@Lakshay_Verma @ppr @balupad14

Hey gentlemen!

Thanks for the help
I will try your suggestions and get back to you in an hour or so

Thank you!! :+1:t4:

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