Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 162
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
search function using wildcard trinatoa Excel Worksheet Functions 3 March 27th 09 02:49 AM
Wildcard search Forgone Excel Worksheet Functions 5 February 18th 09 03:50 AM
help with a wildcard search Billy Craig Excel Discussion (Misc queries) 1 July 1st 08 04:12 PM
Retrieving contents of wildcard match in search and Replace [email protected] Excel Programming 1 November 3rd 05 08:15 PM
Wildcard search functions within Vlookup Benn Excel Worksheet Functions 2 July 26th 05 01:12 PM


All times are GMT +1. The time now is 09:46 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"