Dynamic Excel Read value into variable

Hi Friends

I am working on dynamic Excel Automation.
where I need to pic data from cell and store it in a variable.
image
like in the image I have to pic today data i.e. 123 and store in a variable and tomorrow data i.e. 421 and store in a variable.

Please help

1 Like

Hi :wave: ,
If i understand correctly you trying to get the excel values you can use the “Read range” activity and pass the output datatable into “for each row” activity to compare and that the values into the data table and pass them to the excel.

Hi Lwissitoon,

I have to only read today data i.e. 123 in a variable and tomorrow data i.e.421 in a variable and it can be anywhere in the excel so first I have to find in today and go one cell right copy data and then find tomorrow and go one cell right and copy data.

Well if that is someone has the same issue here check it out
Let us now if works for you : How to check if a certain string exists in a data table? - #5 by pal1910

Would the columns vary as well?
Can you post another variation of this sheet to understand better?

Hi Kaderms
Yes column will also vary

These cells can be anywhere in the Excel we just need to copy the value in a variable

hi @ravi.g6 ,

  1. Read the Excel using Excel Application scope.
  2. Read Range : SheetName : This will bring the scope to the current sheet where we have to find the data.
  3. Take a Look up Range Activity : Look up for Text “today” . This activity will return you the cell number for “Today” i.e. D4

More details on LookupRange : https://docs.uipath.com/activities/docs/excel-look-up-range

  1. Take an assign activity and using string manipulation , get the value “E4” - Assuming 123 is always in the right side … so if today cell number is A123 , This assign will give you B123.
  2. Take a Read cell and pass E4 - This will give you 123.

Second way :

Use an AnchorBase activity with anchor to “today” and Read Cell in the action.

--
Mukesh

2 Likes

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