C
caroline
I am trying to see if a name already exists in a list. It
works with the following code (except that it does not
recognise capital letters, for instance it will not
detect that Smith and smith are the same). I tried also
with Cell.text instead of Cell.value, but it gives me the
same problem. Any idea?
Dim Var As Range
Set Var = Range("list")
Dim Cell As Range
For Each Cell In Var
If Cell.Value = Range("newname").Value Then
MsgBox "This name already exists"
Exit Sub
End If
Next Cell
works with the following code (except that it does not
recognise capital letters, for instance it will not
detect that Smith and smith are the same). I tried also
with Cell.text instead of Cell.value, but it gives me the
same problem. Any idea?
Dim Var As Range
Set Var = Range("list")
Dim Cell As Range
For Each Cell In Var
If Cell.Value = Range("newname").Value Then
MsgBox "This name already exists"
Exit Sub
End If
Next Cell