Livin404
Well-known Member
- Joined
- Jan 7, 2019
- Messages
- 743
- Office Version
- 365
- 2019
- Platform
- Windows
Greetings I have an excel table and on row 2 from column B to column R (B:R) there is a number followed by a dot/period. For example 12., 13., 14. 15. 16. etc.
I am hoping to have a VBA remove the number and period. For example I have 21. FLEET after the VBA I will have only "FLEET".
I found in an old entry from Mr. Excel which I think will work. Except I only want it to apply to ROW2 between Columns B and R.
Thank you so much,
I am hoping to have a VBA remove the number and period. For example I have 21. FLEET after the VBA I will have only "FLEET".
I found in an old entry from Mr. Excel which I think will work. Except I only want it to apply to ROW2 between Columns B and R.
VBA Code:
Sub RemoveNumbersFromColumnB()
Dim X As Long, R As Long, Data As Variant
Data = Range("B1", Cells(Rows.Count, "B").End(xlUp))
For R = 1 To UBound(Data)
For X = 1 To Len(Data(R, 1))
If Mid(Data(R, 1), X, 1) Like "[0-9]" Then Mid(Data(R, 1), X) = " "
Next
Data(R, 1) = Replace(Data(R, 1), " ", "")
Next
Range("B1").Resize(UBound(Data)) = Data
End Sub
Thank you so much,