How to get Row and Colum index separately when searching a value in excel

I am searching for value in excel which I found out in say “AB10”, how to get AB and 10 separately?

1 Like

Use Regex expression to extract both alphabets and digits separately.

1 Like

how do i extract them separately?

@Darshan_Hadagali

Use the Regex matches activity and Input will be “AB10”
Pattern will be [A-Z]+ for Alphabets (IgnoreCase)
Pattern will be \d+ for digits.

1 Like

Hi @Darshan_Hadagali,
Here I have demonstrated your situation.

Sample : Darshan_Hadagali.zip (30.0 KB)

Excel Activities are :


Regards
Balamurugan.S

1 Like

Thank You @SowmyaLeo. Worked.
My intention is to move up, down, sideways as specified by user after identifying a particular cell.
If I have received AD19 from your regex and now the user tells me to get the value from 2 cells right side of AD19 which is AF19, how to get AF from AD?

Thank You @balupad14. However when I extracted your code, some activities were highlighted in RED and i guess they weren’t imported correctly.
Thank for your help anyways.

1 Like

@Darshan_Hadagali

You should be able to use the DataRow and the Column Index to navigate to other cells.

I got this support article hope this helps!

Regards,
lewis

This worked. But, how to get the row number as Integer? I am now getting them as Object variable

@Darshan_Hadagali

I presume you are using a for each row activity.

If so, you can get the Index by assigning an Int32 variable to Index.

If it is some other way you can just use a Convert.ToInt32(variableName.ToString)

1 Like

Convert.ToInt32(variableName.ToString) - Worked. Thank much!!

1 Like

@Darshan_Hadagali

Good to know. Please can you mark the relevant answer as Solution as it makes it easier for others to refer to.

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