I need to replace a substring in a string in a variable.
For example, in a string that contains "&Cost=6789&" i want to replace the "6789" with a new numeric value, without knowing in advance the value (6789) that I am replacing, and without knowing in advance how long the (6789) string is.
Using wildcards, I would be replacing "&Cost=*&" with "&Cost=" & NewValue where NewValue is the value I want to replace 6789 with.
I think I found a solution eralier that didn't require me to use excel cells, but with moving between work and home computers I've misplaced it. From memory it used something like Application.WorksheetFunction.replace , but I don't recall the exact code.
Bookmarks