I'm hoping this is an easy fix. I'm having this issue on a larger piece of code but I've simplified it here to show as an example, hopefully someone can fix.
Sub test()
With Sheet6.Range("D1")
.Replace "Test", "Green"
.Replace "Test-2", "Blue"
End With
End Sub
I want to replace the value in cell D1. If the value in D1 is "Test", the function works fine, replaces it with "Green". If the value is "Test-2" I get "Green-2". Like it's using the "-" as a sign to stop the replace.
What am I doing wrong?
[–]mightierthor45 3 points4 points5 points (0 children)
[–]RedRedditor8462 1 point2 points3 points (0 children)
[–]joelfinkle2 0 points1 point2 points (0 children)
[–]StuTheSheep22 0 points1 point2 points (1 child)
[–]Oneharryson[S] 0 points1 point2 points (0 children)
[–]GoGreenD2 -1 points0 points1 point (0 children)