View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default Vlookup - Multipel results

Try applying an Autofilter to your data (Data=Filter=Autofilter). Set the
surname filter to the surname of interest and all lines with that surname
will be visible, while others will be hidden. If you need a macro, you can
turn on the macro recorder while doing it manually. It is only a single
command with a few arguments. Vlookup would be the wrong command to use.
Match would tell you the first row where the data is found, so if you don't
want to use the autofilter, you would use match and then if the list is
sorted by surname, you could search below that location. Another approach
would be to use the Find method of the range object. The example code in
the help file shows you how to search for multiple instances. The would be
expecially appropriate if your list is not sorted.

--
Regards,
Tom Ogilvy

"Les Stout" wrote in message
...
Good day,

i am very new at this game and have written some code to do a Vlookup to
find the name entered into an input box, it works fine but the problem
is there are at times more than one with the same Surname!
Could somebody help me with some code that would enable me either see a
list of the names or to "find next" and display?


Les Stout

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!