It seems most of the answers for this involve C# so I felt relatively safe asking:
I need to call a dictionary key by it's value. I have a dictionary object with a list of four character keys. For Example:
dSCAC.Add "AAAA", 1
dSCAC.Add "BBBB", 2
dSCAC.Add "CCCC", 3
dSCAC.Add "DDDD", 4
etc.
I've been able to call the value associated with a key when it's found in a string (in this case, an email subject line) and then add or remove 1 from the value.
Ex: BBBB is detected, value is 2. Modify the value and call the appropriate key. In this case, in the end we'd want varOtherSCAC = AAAA.
If dSCAC(varSCAC) Mod 2 Then
Debug.Print "Odd " & "PAPS"
varOtherSCAC = (dSCAC(varSCAC) + 1)
Debug.Print "Opposite SCAC is " & varOtherSCAC
Else
Debug.Print "Even " & " PARS"
varOtherSCAC = (dSCAC(varSCAC) - 1)
Debug.Print "Opposite SCAC is " & varOtherSCAC
End if
I haven't been able to work out the syntax for calling the new key based on this value. Is it even possible in VBA? Is there a way around this?