Vlookup looping through multiple cells

Hi, first time posting. I am trying to perform a vlookup using UiPath. I have figured out how to do a vlookup for 1 value. However, I want to run it for multiple values (Lookup the word in Column A, and take the value in Column B and paste it to the matching Column A value in a different sheet). Is there a way to run it for multiple values and not have to manually change the look up value to what’s in C!

Capture|690x68 olumn A?

1

Hi @t45521502, Welcome to the UiPath community!!

In the image I can see that, you’ve given default value as Cap for your lookupValue variable, and done your process successfully for that value only.
But now, you want to do the same process for all 3 values. so to achieve the same, firstly remove default value, don’t specify anything there, keep it empty as shown in below shot.
image

To do same process for each row in excel we use For Each Row activity, follow these for your workflow.

  1. Use Read Range activity, in excel application scope to get excel data in DataTable variable, make sure to uncheck AddHeaders property as you have no headers in excel sheet (direct data) and create output datatable parameter by using ctrl+k and it a name —> DT
  2. Use For Each Row specify that DT datatable here.
  3. Use Assign activity inside that for each row, like this
    —> lookupValue = row(0).ToString.Trim
    to get value from first column (for each iteration).
  4. Use your actual process here, sequence of your activity, which you’ve done previously.

here’s screenshot for your better understanding,

1 Like

Thanks for the help! One issue I am running into is that it is writing in the wrong cell and writing the wrong values. I used a counter variable to have it move down but it is starting in the wrong cell. Any thoughts on how to fix it?

OI should be 4 and Cap should be 3.