1

OK Starting all over again and hopefully a bit more straight forward.

Var = 24
string = "var"

x = string

This results in

x = "var" NOT x = 24

Is it possible to retrieve the value of var, by using the string stored in string

Thank you

Aaron

1 Answer 1

3

I don't believe you are able to do that. As a solution you can use a collection to mimic this behaviour:

Sub TestCollection()
  Dim Values As New Collection

  Values.Add "24", "Var"
  Values.Add "Alexander", "Name"

  MsgBox Values("Var") & " " & Values("Name")
End Sub 
Sign up to request clarification or add additional context in comments.

3 Comments

HI please see my edit above so explain a bit more what i need.
I think what also might explain it better is how once I have pulled out the "port" string from the whole string, do i use that to find the associated value.
Exactly what I need, in fact at about 1am this morning a friend also suggest the same idea. Still haven't tested it yet, but can't believe I didnt think of this. I have used discretionary's in C# so the same thing and perfect for what I want. Thank you so much for that answer and sticking with it. Aaron

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.