Hi, yea saw that within a few minutes. I found trying to replace just one character in the middle-ish of a string to be problematic so I went with breaking the string into its parts
Code:
Function MakeDashes(str As String)
Dim i As Integer, n As Integer
Dim str1 As String, str2 As String
n = InStr(str, " ") + 1
str1 = Left(str, n - 2)
str2 = Mid(str, n)
Debug.Print str1
For i = 1 To Len(str1)
str1 = Replace(str1, Mid(str1, i, 1), "-")
Next
For i = 1 To Len(str2)
str2 = Replace(str2, Mid(str2, i, 1), "-")
Next
str = str1 & " " & str2
Debug.Print str
End Function
RegExp is almost always neater. I just never learned it (too old now to be bothered, I think).