How to apply Vlookup in two different Excel files for more than 5 columns by considering one column in one excel?

Fine
Hope these steps would help you resolve this
—use excel application scope and pass the file path of first excel as input
—inside the scope use Read range activity and get the output with a variable of type datatable named dt1
—again use another excel application scope and pass the file path of second excel as input
—inside that use read range and get the output with a variable of type datatable named dt2
—now use a for each row loop and pass the above
Variable dt1 as input and change the variable name from row to row1
Inside this loop use another for each row loop and mention the input as dt2 and change the variable name from row to row2
Now use a IF condition like this inside the inner for each row loop
row1(0).ToString.Equals(row2(0).ToString)
If this condition passes it will go to THEN part where we can use assign activity like this
row2(1) = row1(1).ToString
And another two assign activity like this
row2(2) = row1(2).ToString
row2(3) = row1(3).ToString

We don’t need to use lookup for this case
Cheers @Priyanka_Sorate

Ok thanks .

Cheers @Priyanka_Sorate

I tried for above .But I require this process by using Vlookup.Please provide solution.

@Priyanka_Sorate
LINQ statement should solve the task. Let me know if its still open

Yes,I have also same query.Please provide this solution through VB using uipath…

@Sneha11 welcome to the forum
I can work out soon a sample but some requirements are to clear:

@Priyanka_Sorate
faster for me would be if you would share excel samples or data as text
second excel is empty on the 2nd, 3rd… cols
so your expected output are all rows and columns from excel1 except row with id 105 as it is not matching Excel 2. Am I right?

yes your saying is correct.I require this only in VB using vlookup concept.Thanks

@Priyanka_Sorate
give me some littel time I will work out within in a free slot.

Ok no problem

@Priyanka_Sorate
PFA sample XAML
Priyanka_Sorate.xaml (12.5 KB)

Just integrate it later into your implmentation and replace the Build DataTable with your logic for readin the Excels into DataTables. Take Care about the VariableNames and may adopt as well.

Ensure Following:

Let us know the result and any open questions. If its working so flag the solution post that others can identify quickly. Thanks

1 Like

I tried this one but another type of error is there so I am working on that &as early as possible I will convery about this.Thanks

@Priyanka_Sorate,

Use invoke VBA or Run Macro and invoke a macro that does it. :slight_smile:

@Priyanka_Sorate
I didnt get you. But lets sort out 1 by 1

  • My XAML is usable standalone, so you can inspect on how to realize and that it is working without macro or invoke code

  • is the error related to my xaml or anything else?

However post it and we will help you. Or just share your XAML and will have a look on it

By invoke VBA method it is done.but requirement is by vlookup.

Thank you .
Activity flow is as shown in attached file.It is executing but output is not generated

.From your solution ,little bit confusion about that.Vllokup is not used in this case.Our requirement is that vlookup should apply for this Scenario.

1 Like

@Priyanka_Sorate
With linq similiar Things can be implemented with same outcome. The result is to checked. Any other questions e.g. in the linq Statement?

Your flows are confusing related to readin excel
Use Excel Application scope
Use read range directly

Others Options for Support you have as well: share xaml or Excel with us, thanks

@Priyanka_Sorate
If you know the formula then why dont you use it in write cell
and then by using Auto fill range you can apply till last row…

TRY this

Ok thank you