开发者

vba strings replacing

开发者 https://www.devze.com 2023-03-06 00:44 出处:网络
OK Starting all over again and hopefully a bi开发者_Python百科t more straight forward. Var = 24 string = \"var\"

OK Starting all over again and hopefully a bi开发者_Python百科t 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


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 
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号