Skip to main content
Nintex Community Menu Bar

Getting a value by searching another value (dictionary) with macro

  • April 14, 2021
  • 6 replies
  • 21 views
  • Translate

I have an Excel file with two columns (code, sum) and I want to find a specific value by searching the sum in that same row for example: I want to get the 'code' 8 by searching the sum 8000 by using an Excel macro function (or the query from excel)

example of the excel file:

 

Did this topic help you find an answer to your question?

6 replies

Hey @דניאל ליכטנשטט​ thank you for raising this question! This Excel thread might be helpful with addressing your concerns: https://community.kryonsystems.com/KryoNet/s/question/0D51o00006oiG92CAE/running-macro-from-the-studio

Translate

I know how to work with macro

I just dont know how to build this macro...

I tried some stuff but it didnt worked, so I asked here...

Translate

  • 2 replies
  • August 29, 2022

Hi @דניאל ליכטנשטט​ , you can use vlookup command in your macro to achieve what you want to do - sRes = Application.VLookup("8000",shData.Range("A2:B7"),2) will return 8 - adapt the range to the table range in your Excel sheet, and adapt the column of the returned value (in the example the returned value is in the 2nd column). I hope it helps

 

Translate

thats great thank u

what if I want the value that I'm searching for to be a variable (it will come from the user)

how do I accomplish that?

Translate

I wrote this macro and it gave me nothing (I'm sure that I did worng)

can u please help me with it?

this is the macro I wrote the two columns are like that (code, amount)

 

Translate

@דניאל ליכטנשטט​ 

If you want an output from macro in Kryon then need to create a function which returns a value. Like below

 

 

attaching wizard for your reference. it is build on version RPA 20.09.

Translate

Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie Settings