Hi Folks,
I've been using the macro below to clean non-alphnumerical data but rather than having to select the range each time, want it to apply it to a Named Range in Sheet2 called INPUT. Please can you edit the code below to do this?
Many thanks in advance!
Steven
I've been using the macro below to clean non-alphnumerical data but rather than having to select the range each time, want it to apply it to a Named Range in Sheet2 called INPUT. Please can you edit the code below to do this?
VBA Code:
Sub ReplaceSpecial()
Dim cel As Range
Dim strVal As String
Dim i As Long
Application.ScreenUpdating = False
For Each cel In Selection
strVal = cel.Value
For i = 1 To Len(strVal)
Select Case Asc(Mid(strVal, i, 1))
Case 32, 48 To 57, 65 To 90, 97 To 122
' Leave ordinary characters alone
Case Else
Mid(strVal, i, 1) = " "
End Select
Next i
cel.Value = strVal
Next cel
Application.ScreenUpdating = True
End Sub
Many thanks in advance!
Steven