Search text with accents and unaccented uppercase and lowercase.

marreco

Well-known Member
Joined
Jan 1, 2011
Messages
609
Office Version
  1. 2010
Platform
  1. Windows
I need to do a search through a textbox, but when it is necessary that the search, it will be accepted texts with one hundred percent free, uppercase and lowercase.


example:
The records in the worksheet was done this way: mike gate.


when I search I would like to enter as well.


MIKE GATE, mike gate.


and returns the result in my search mike gate.


example2:
The records in the worksheet was done this way: josé landmarks.
I must return josé landmarks even if I type in the textbox like this: JOSE MARCOS, or jose marks (without Seat ').


this is possible?
 

Excel Facts

Format cells as date
Select range and press Ctrl+Shift+3 to format cells as date. (Shift 3 is the # sign which sort of looks like a small calendar).
I need to do a search through a textbox, but when it is necessary that the search, it will be accepted texts with one hundred percent free, uppercase and lowercase.


example:
The records in the worksheet was done this way: mike gate.


when I search I would like to enter as well.


MIKE GATE, mike gate.


and returns the result in my search mike gate.


example2:
The records in the worksheet was done this way: josé landmarks.
I must return josé landmarks even if I type in the textbox like this: JOSE MARCOS, or jose marks (without Seat ').


this is possible?

Example 1 is easy enough. Assume the search range is B2:B50
Sample Code:
Dim c As Range
For Each c In Range("B2:B50")
If UCase(c.Value) = "MIKE GATE" Then
MsgBox LCase(c.Value)
End If
Next
The message box would return "mike gate", No matter what letters were capitalized.
Example two would be a little more difficult to handle with any degree of certainty, at least for me it is, because the only method I can think of immediately is to use wild cards. Something like this.
Example Code:
Sub t()
Dim c As Range
For Each c In Range("B2:B50")
If UCase(c.Value) Like "JO*MAR*" Or UCase(c.Value) Like "JO*E *MAR*" Then
MsgBox c.Address & " could be Jose Landmark"
End If
Next
End Sub
 
Upvote 0
example2:
The records in the worksheet was done this way: josé landmarks.
I must return josé landmarks even if I type in the textbox like this: JOSE MARCOS, or jose marks (without Seat ').
If you want a solution to your problem, you are going to have to explain to us... in detail... the rule you are following that allows JOSE MARCOS (or jose marcos) to match josé landmarks. Would, for example, jose land match it? How about jose manville?
 
Upvote 0
I wish my textbox, when it entered the names that were sought for the listview, all names in the worksheet rerenre digitdo that name in the textbox.






example:
Textbox1 = maria


If you are in my spreadsheet as well.


MARIA
maría
maria
should appear in the listview three names, not just the maria.
 
Upvote 0
I wish my textbox, when it entered the names that were sought for the listview, all names in the worksheet rerenre digitdo that name in the textbox.

example:
Textbox1 = maria

If you are in my spreadsheet as well.

MARIA
maría
maria
should appear in the listview three names, not just the maria.
I understand the first name match (ignore accents on letters), that is not a problem, but I do not understand the last name match at all. You said this...

"I must return josé landmarks even if I type in the textbox like this: JOSE MARCOS, or jose marks (without Seat ')."

Why is "MARCOS" a match for "landmarks" ???
Why is "marks" a match for "landmarks" ???

Can you explain why those last names match?
 
Upvote 0

Forum statistics

Threads
1,206,718
Messages
6,074,500
Members
446,072
Latest member
OrangeYellow

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top