LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Multiple Lookup in VBA

Hi

I have created the following generic function which use
Excel Vlookup function to find the exact match. It works
fine however I am trying to create another function
similar to this but which would return multple matches in
an array e.g if their are dupliacets get all exact matches
of the part # with corsponding values. Is it possible &
how.

Function SearchSku(Pno As String, WB As String, Sheet As
String, SCol As Long, GetCol As Long)
Res = ""

Dim wks As Worksheet

Set wks = Workbooks(WB).Sheets(Sheet)
Set r = wks.Range(wks.Cells(1, SCol), wks.Range
("IV60000"))

Res = Application.VLookup(Pno, r, GetCol, False)
If IsError(Res) Then
SearchSku = ""
Else
SearchSku = Res
End If

End Function


Thanks a million

James B.
Xl2K vba
 
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
Lookup across multiple columns within multiple sheets Garnet Excel Discussion (Misc queries) 2 June 25th 08 11:46 PM
Multiple lookup values and adding multiple rates across together ssolomon Excel Worksheet Functions 5 November 16th 07 09:02 PM
Lookup using multiple sheets and multiple criteria, sorry if 2 pos kjguillermo Excel Worksheet Functions 4 January 16th 07 03:21 AM
Lookup using multiple sheets and multiple criteria kjguillermo Excel Discussion (Misc queries) 2 January 14th 07 10:28 AM
Lookup in Multiple Columns, Return Multiple Values andy62 Excel Worksheet Functions 3 July 6th 06 02:36 AM


All times are GMT +1. The time now is 08:12 AM.

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

About Us

"It's about Microsoft Excel"