I have the following format: Value1 is {0} and Value2 is {1}.
I need to replace the numbers in the brackets with strings. This is easily done in most languages usin
Why not? This code works here:
value1 = "1"
value2 = "2"
strFormat = "Value1 is {0} and Value2 is {1}."
strFormat = Replace (strFormat, "{0}", value1)
strFormat = Replace (strFormat, "{1}", value2)
MsgBox strFormat
Note I update my strFormat value for every replace.
If you needs a more flexible implementation, you can go with a regular expression, but doesn't seems required now.