How to get an excel value next to a known excel address (with modern activities)

Hello everyone,

I would like to use a offset function for some excel ranges, just like this one here, but with modern Activities I can’t seem to find a way to do that.

My Setup is the following:

I use a single excel process scope for a excel which I retrieve through an email.
Then I search for a specific string to find the title/field name of the field I want, in this case a personal number.
Afterwards I would like to read the cell value, but not from the field name, but the cell right next to it.

So for example, if the Find Address activity returns “C3”, I would like to read from “D3”.

Does anybody know how to do that in UiPath?

Hi @niki.rmoutil

Below are the steps you need to do. Let’s Take your Example of “C3”.

  1. Split C3 and Put “C” in one variable_1 and “3” in another variable_2.
  2. Use ‘Assign’ Activity and in the value type Asc(Variable_1) and Save it to the Variable_3 of type int. This will Convert the Character into integer.
  3. Use another ‘Assign’ Activity and in the Value type Chr(Variable_3 +1) and save it to Variable_1. Now, if Variable_1 Previously has C, it is Converted to D.
  4. Using another assign Activity you can again concat the Variable_1 & Variable_2 and then got the “D3” Cell number.

Hope this works,
Best Regards.

Hello @niki.rmoutil
Try this
If You Get Position C3, Separate the Letter from it

LetterVar= System.Text.RegularExpressions.Regex.Match("C3","\D+").Tostring.Trim  ---->C


NextLetterVar=UiPath.Excel.Helpers.ExcelUtilities.ConvertColumnIndexToColumnLetter(Uipath.Excel.Helpers.ExcelUtilities.ConvertColumnLetterToColumnIndex(LetterVar)+1)   ----->D

PostionNumber=System.Text.RegularExpressions.Regex.Match("C3","\d+").Tostring.Trim  ------> 3

ReadCellValue=NextLetterVar+PositionNumber   ------> D3

image

1 Like

Hi @pratik.pandya

thank you for your answer, I forgot to mention that I’m using C#

Hi @Gokul_Jayakumar

thank you for your answer.
I tried it but the Intellisense doesn’t seem to want me to add the UiPath.Excel.Helpers.ExcelUtilities Package.
This discussed that problem, but it seems there wasn’t a real solution for that, other than hoping it will show up sometimes.

Edit:
Okay, it seems it resolved itself somehow after giving me a bunch of error messages.
Well, thank you! Solved my issue.

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