Hi
I am working on a solution to remove any stray numbers that may appear in text in a selected range: Range("N3:Q" & lastRow).Select.
I have found a partial solution on here by Rick Rothstein (see below) but it is only for one column and, with my rather limited VBA skills, I haven't been able to adapt it to work with my selection.
Any help would be greatly appreciated.
Many thanks
TE
I am working on a solution to remove any stray numbers that may appear in text in a selected range: Range("N3:Q" & lastRow).Select.
I have found a partial solution on here by Rick Rothstein (see below) but it is only for one column and, with my rather limited VBA skills, I haven't been able to adapt it to work with my selection.
Any help would be greatly appreciated.
Many thanks
TE
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) = Chr(1)
Next
Data(R, 1) = Application.Trim(Replace(Data(R, 1), Chr(1), ""))
Next
Range("B1").Resize(UBound(Data)) = Data
End Sub