Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi
change the line If Cell.Value = Range("newname").Value Then ro If lcase(Cell.Value) = lcase(Range("newname").Value) Then -- Regards Frank Kabel Frankfurt, Germany caroline wrote: 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 |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
try
If Cell.Value = Range("newname").Value Then If ucase(Cell.Value) = ucase(Range("newname").Value) Then -- Don Guillett SalesAid Software "caroline" wrote in message ... 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 |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Great. both suggestions lcase and ucase work
Thanks -----Original Message----- try If Cell.Value = Range("newname").Value Then If ucase(Cell.Value) = ucase(Range("newname").Value) Then -- Don Guillett SalesAid Software "caroline" wrote in message ... 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 . |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Can an excel cell/column be forced to CAPITAL letters only? | Excel Discussion (Misc queries) | |||
how to change small letters to capital letters | Excel Discussion (Misc queries) | |||
how do i turn all letters into capital letters? | Excel Discussion (Misc queries) | |||
Capital Letters Only | Excel Discussion (Misc queries) | |||
Capital Letters | Excel Worksheet Functions |