How to get particulate cell value based on another cell value in excel

Hi Guys,

I want one cell value based on another cell like,

For example:

Cell:
A2=ABC B2=XYZ
A3=DEF B3 =UVW

Once i give ABC automatically get XYZ
i give DEF automatically get UVW

excel
Please anyone help me out from this

Regards,
Raja G

1 Like

Hello @Raja.G,

do this
Assign
listStrVar = (From row in dT.AsEnumerable() where row(“Column1”).ToString.Equals(“ABC”) Select row(“Column2”)).ToList(0)

Cheers
@Raja.G

1 Like

Hi @Raja.G well u try this too

  1. use input dialog box to capture the user input and store in input1 varible.

  2. use read range to read the excel file and store in dt1

  3. use lookup datatable activity by adding below property panel data

  4. After this use message box to output the output variable

Hope it helps you

Regards

Nived N

Happy Automation

1 Like

Hi @Pradeep_Shiv,

I want dynamic, if i give ABC or DEF i need opposite cell value , your code is static value ABC can you give dynamic, i add already in contain replace to equal but not accept that code can u help me out from this

Regards,
Raja G

1 Like

Hi @Raja.G

I am not sure whether this works

I am just modifying the @Pradeep_Shiv answer a little bit

  1. Use input dialog box to get the input value and store in input varaible

  2. Use read range to read the excel file and store in dT

  3. Use Assign activitiy like this

listStrVar = (From row in dT.AsEnumerable() where row(“Column1”).ToString.Equals(input) Select row(“Column2”)).ToList(0)

Try this way let’s see whether it works

Regards

Nived N :robot:

Happy Automation :relaxed::relaxed:

2 Likes

Hi @Raja.G,

just pass your inputVar instead of “ABC”

Thanks @NIVED_NAMBIAR

2 Likes

Hi @NIVED_NAMBIAR,

Thanks for your help working fine for lookup activity

1 Like

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