indi visual
Member
How do I find the last space in a string, and replace it with "{" ?
Sub Add_Brace2LastWord()
Dim Cell As Range
Dim MyString As String
For Each Cell In Range("A1", Range("A65536").End(xlUp))
MyString = Cell.Value
On Error Resume Next
MyString = WorksheetFunction.Substitute(MyString, " ", "}", Len(MyString) _
- Len(WorksheetFunction.Substitute(MyString, " ", "")))
On Error GoTo 0
Cell.Value = MyString
Next
End Sub