ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Vlookup - Multipel results (https://www.excelbanter.com/excel-programming/289954-vlookup-multipel-results.html)

Les Stout

Vlookup - Multipel results
 
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!

Tom Ogilvy

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!




Tempy

Vlookup - Multipel results
 
Thanks Thom,

Your help is appreciated

Les Stout

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


All times are GMT +1. The time now is 10:52 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com