Hello, I can use the code below in column A. It doesn't work when I use it on the same column E. What changes do I need to make to make it work?
Code
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Column <> 1 Then Exit Sub
Application.EnableEvents = False
On Error Resume Next
For XD = 1 To Target.Rows.Count
XDD = Cells(Target.Row + XD - 1, 1).Value
For k = 1 To Len(XDD)
code = Asc(Mid(XDD, k, 1))
Select Case code
Case Asc("0") To Asc("9")
Case Asc("A") To Asc("Z")
Case Asc("a") To Asc("z")
Case Asc(".")
Case Asc("-")
Case 199
Case 208
Case 214
Case 220 To 222
Case 231
Case 240
Case 246
Case 252 To 254
Case Else
krt = Mid(XDD, k, 1 count = count + 1
Cells(Target.Row + XD - 1, 1).Value = Replace(Cells(Target.Row + XD - 1, 1), krt, "")
mtn = mtn & ", " & krt
End Select
Next
Next
If say >= 1 Then: MsgBox " Deleted characters:" & vbLf & vbLf & Mid(mtn, 2, Len(mtn)), vbCritical
Application.EnableEvents = True
End Sub
Display More