I have a formula that works
=TRIM(RIGHT(SUBSTITUTE(A3," ",REPT(" ",LEN(A3))),LEN(A3)))
and a macro that works. But not together. Can someone tell me where I need to add quote marks or what it will take to make this work?
I get Compile error: Sub or Function not definded with Rept highlighted.
Thanks,
=TRIM(RIGHT(SUBSTITUTE(A3," ",REPT(" ",LEN(A3))),LEN(A3)))
and a macro that works. But not together. Can someone tell me where I need to add quote marks or what it will take to make this work?
VBA Code:
Sub SplitLastSpace()
Application.ScreenUpdating = False
Dim c As Range
Dim Lastrow As Long
Lastrow = Cells(Rows.Count, "A").End(xlUp).Row
For Each c In Range("A2:A" & Lastrow)
c.Value = c.Value = Trim(Right(Substitute(A2, " ", Rept(" ", Len(A2))), Len(A2)))
Next
Application.ScreenUpdating = True
End Sub
I get Compile error: Sub or Function not definded with Rept highlighted.
Thanks,