replace vba syntax code example
Example: vba replace
' Replace into string
Sub TestMe()
Debug.Print Replace("a,B,c,d,e", ",", "-") 'a,B,c,d,e -> a-B-c-d-e
Debug.Print Replace("Mr XXX", "XXX", "Bond") 'Mr XXX -> Mr Bond
Debug.Print Replace("a,b,c,d,e", ",", "-", 3, 2) 'a,B,c,d,e -> b-c-d,e
End Sub