
Originally Posted by
Kindyr
I am trying to make macro to add dashes between all the letters in a word. I want to have names be spelled out with dashes between them. I do not want the name to be automatically upper case.
Try the following. Put the cursor in the word and run the macro
Sub Macro1()
Dim orng As Range
Dim i As Integer
Set orng = Selection.Words(1)
orng.MoveEndWhile Chr(32) & Chr(45), wdBackward
For i = orng.Characters.Count - 1 To 1 Step -1
orng.Characters(i).InsertAfter Chr(45)
Next i
Set orng = Nothing
End Sub