Reading corresponding value in an excel - Dictionary not working

Hi,

Reposting as old thread is closed

Need to get the corresponding value to a string of 1 column by referring to the value of it adjacent column.

Eg.:

image

Need to get ouput as PAR while giving the input as F786.
I need to get the first column values by putting the second row string.

I tried creating the Dictionary for this but getting following error.

Can anyone help in creating this dictionary successfully?

CofDictProj.zip (26.9 KB)

Set the default value of CofelyDictionary to New Dictionary(Of String, String).

2 Likes

@alpharobot
as @Anthony_Humphries mentioned init your dictionary as he has described

looking to your table and xaml

DOMANE AGENCE N° AGENCE N° SOCIETE
GALA ALA F001

You sset Dict enty with:
For Key: CofelyDictionary(row(0).ToString)
With Value: row(1).ToString

but it looks to me that the key is No Societe col and value is Domane Agence / or No Agence

give a try on
For Key: CofelyDictionary(row(2).ToString)
With Value: row(1).ToString or 0 for other columns

YourDictVar(“F001”) should then return ALA

1 Like

Thank you so much, @Anthony_Humphries

Your solutions are really helpful! :slightly_smiling_face:

Sorry for the silly doubts and mistakes but I am new to this in my internship and have a non tech background. :sweat_smile:

Yes, Understood my mistake

thanks for the reply @ppr :+1:

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