I am working in Excel to take a faulty URL and replace the incorrect characters. The characters I want to replace are "%20" BUT there is no way to know how many of those characters will be in the string. There might be just one "%20" or 5 "%20%20%20%20%20" or any other number of them in between but no matter how many "%20" characters there are I want to replace with only ONE forward slash "/".
I know I can use something like below, but don't want to end up with more than one forward slash if there are more than one "%20"
Sub fixURL()
Worksheets("Google Feed Original").Activate
Worksheets("Google Feed Original").Columns("N").Replace _
What:="%20", replacement:="/", LookAt:=xlPart
End Sub
For example the starting URL might look like:
http://domainname.com/products/prodName%20%20%20ProdNumber
and no matter how many "%20" are in the middle, I am trying to get it to format like this instead:
http://domainname.com/products/prodName/ProdNumber
Is there some way I can replace all of them with just one "/" no matter how many "%20" are in the string?
Thanks.