Livin404
Well-known Member
- Joined
- Jan 7, 2019
- Messages
- 743
- Office Version
- 365
- 2019
- Platform
- Windows
Hello the following code I used in the past on another project. In this case I need to change it so it will start on Row 5 of Column F and the range will depend on the height of my table. I do not need a input box.
VBA Code:
Sub RemoveAllNonNums_Macro()
Dim myR As Range
Dim myRange As Range
Set myRange = Application.Selection
Set myRange = Application.InputBox("select one range that you want to remove non-numeric characters", RemoveAllNonNums, myRange.Address, Type:=8)
For Each myR In myRange
myOut = ""
For i = 1 To Len(myR.Value)
tmp = Mid(myR.Value, i, 1)
If tmp Like "[0-9]" Then
myStr = tmp
Else
myStr = ""
End If
myOut = myOut & myStr
Next i
myR.Value = myOut
Next
End Sub