Lookup range only in a particular column

Hi,

I need to lookup for a cell coordinates in excel using Lookup Range activity.

  1. The range will be the entire column AI. How to give the range value in this case?
  2. If suppose, I find first occurence of my value at AI5. Now I’ll use one more lookup range activity to search from AI5 to last row in column AI(Only in column AI). How to give range in this case?

Thanks in advance

Hi @Surya_Narayana_Korivipadu - Have you tried AI:AI?

No. I didn’t try. I’m not sure if I can use that in UiPath activity. I’ll try

By the way, do you know any solution for my second activity?

To get the last value in the column (below code will help you even there is a blank rows and if other columns has different row numbers)

 Dt.AsEnumerable.ToList.FindLastIndex(Function (x) Not (isNothing(x("Column1")) OrElse String.IsNullOrEmpty(x("Column1").toString.Trim)))

Add +2 to get the exact value. i.e if the above code returns 15 , your exact values is at 17.

or You can use StudioX functionality in Studio which will do this job easily.

image

1 Like

ok.

I’m thinking if there’s any easy way instead of reading to datatable. It would be helpful if it works with “AI5:AI”. But this won’t work.

However, I read range of this excel sheet to a datatable and used datatable.rows.count to find the last row.