tiredofit
Well-known Member
- Joined
- Apr 11, 2013
- Messages
- 1,913
- Office Version
- 365
- 2019
- Platform
- Windows
I have this code in Sheet1 to remove duplicates:
If I type 1 into cell A1, nothing happens, as expected.
If I then type 1 into cell A2, the code reverses and cell A2 becomes blank, also as expected.
Suppose instead of the value 1 but I type the value 1@ into cell A1. Again nothing happens.
But if I now type 1@ into cell A2, the code DOES NOT reverse that value, even though it's already in cell A1.
Is there something special with @ symbols?
Code:
Option Explicit
Private Sub Worksheet_Change(ByVal Target As Range)
If Application.CountIf(Me.Columns(1), Target.Value) <> 1 Then
Application.EnableEvents = False
Application.Undo
Application.EnableEvents = True
End If
End Sub
If I type 1 into cell A1, nothing happens, as expected.
If I then type 1 into cell A2, the code reverses and cell A2 becomes blank, also as expected.
Suppose instead of the value 1 but I type the value 1@ into cell A1. Again nothing happens.
But if I now type 1@ into cell A2, the code DOES NOT reverse that value, even though it's already in cell A1.
Is there something special with @ symbols?