davedave24
Programmer
I'm using the following code to find a string in a range, to see if the user enters a duplicate customer name:
Some of the names contain characters such as periods and hyphens. Others contain spaces. Is there a function to detect similar strings? For example:
A Hart
AHart
A-Hart
A.Hart
ABC
A.B.C.
A-B-C
A B C
Code:
Dim rngFind As Range
With Workbooks("Aug10").Sheets("Customers").Range("A:A")
Set rngFind = .Find(textCustomerName.Text, , xlValues)
End With
If rngFind Is Nothing Then
'do my stuff
Else
'alert the user to a duplicate
End If
Some of the names contain characters such as periods and hyphens. Others contain spaces. Is there a function to detect similar strings? For example:
A Hart
AHart
A-Hart
A.Hart
ABC
A.B.C.
A-B-C
A B C