Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
VLookup / HLookup Wildcard Search ?????
Hi! I am trying to get the Vlookup code to do a search for search part
descriptions. I can get the normal Vlookup / Hlookup to work correctly (only if the word is typed exactly) but I need this to be able to do a search using wildcard characters...Please explain the logic behind the code so that I can understand how to implement this into my spreadsheet. I have looked at a few codes simlar to this request but the logic behind the code isn't explained and I can't figure out how to get information to be populated through those codes...Thanks alot! |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
VLookup / HLookup Wildcard Search ?????
Vlookup is a formula. What do you mean by code.
=Vlookup("ABC*",Sheet2!A:F,4,False) in VBA code Dim res as Variant res = Application.Vlookup("ABC*",worksheets("Sheet2").Ra nge("A:B"),4,False) if iserror(res) then msgbox "Not found" else msgbox "Results are " & res End Sub Wildcard characters a * for 0 to n characters and ? for a single character. Experiment with your data to see what works. You know what you have and what you want. If your part numbers are actually numbers and not text strings, then wildcards are not going to work. You can possibly sort your data and use the approximate match as described in the Excel help on Vlookup. I would expect Hlookup to be consistent. -- Regards, Tom Ogilvy -- Regards, Tom Ogilvy " wrote: Hi! I am trying to get the Vlookup code to do a search for search part descriptions. I can get the normal Vlookup / Hlookup to work correctly (only if the word is typed exactly) but I need this to be able to do a search using wildcard characters...Please explain the logic behind the code so that I can understand how to implement this into my spreadsheet. I have looked at a few codes simlar to this request but the logic behind the code isn't explained and I can't figure out how to get information to be populated through those codes...Thanks alot! |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
search function using wildcard | Excel Worksheet Functions | |||
Wildcard search | Excel Worksheet Functions | |||
help with a wildcard search | Excel Discussion (Misc queries) | |||
Retrieving contents of wildcard match in search and Replace | Excel Programming | |||
Wildcard search functions within Vlookup | Excel Worksheet Functions |