Find Range of cell using column Name

Hi Friends,

Urgent help needed , Any leads would be highly appreciated.
My problem is:

This is an excel sheet i want to find the Cell range index of column name - “Item”, for it i am using

but every time this is giving me range value “E”, i think it is not counting blank cells,
any suggestions that how can i get the original range - “G”,
and this is the case for any column i want to take out the range.
@ppr, @Palaniyappan, @ClaytonM
Feel free for clarifications .!!

Please share headers of your excel file :slight_smile:

headers are , unit, cost,total,value,item,order no, id,upc,mnb,local,desc

@Lakshay_Verma :slight_smile:

If there’s any blank, try using Lookup Range in Excel Application Scope, It will give you exact cell value of this particular column name

LookupValue.xaml (6.1 KB)

hope this helps :slight_smile:Happy Automation

Thanks for the solution @Lakshay_Verma :slight_smile:

but is their a way using any query like i used or function , that i can use , i dont want to use look up range basically due to some job requirements .
Thanks !!

Hello @Shikhar_Tandon
your requirement is clear but your data is not.
As I can see from your screenshot your actual data range starts from C4 (I assuming that it is your start range when you are reading this excel)

but when you do 65 + column.index then there is assumption that your data range starts from A1 [as char 65 represents alphabate A].

kindly let us know how you are reading your excel file, also let us know if start range is dynamic or not.

yes @AkshaySandhu my start range is dynamic , i am reading the excel by passing the first column name that is here is " unit " in a look up range which gives me the starting position or range of data.

can you suggest some solution .

thanks for the rply !

HI @Shikhar_Tandon,

Here is an activity called “Find”. Using this activity you can able to find the string in the excel and it will return the CellInfo and row index. Below I have attached the sample for you.

Sample : (33.0 KB)

Here is the output.

If you know the range , you can specify it in the Cell Range Property.

Thank you

in this case instead of static 65 use dynamic value like below


so you final line of code should look like


strUnitLookUpVal = earlier lookup value that you got for “Unit”


Thanks for the solution @AkshaySandhu but this is giving me , attached in SS .


Btw thanks for the idea @AkshaySandhu , i got what i wanted by doing some modifications on my side :slight_smile: cheers !

1 Like

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