View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
[email protected] amontes@gmail.com is offline
external usenet poster
 
Posts: 8
Default Lookup to return multiple results in one cell

On Apr 12, 1:21 pm, "merjet" wrote:
Function MyLookup(LookFor, FindCol As Range, GetCol As Range) As
String
For Each c In FindCol
If LookFor = c Then
If MyLookup = "" Then
MyLookup = Cells(c.Row, GetCol.Column)
Else
MyLookup = MyLookup & ", " & Cells(c.Row, GetCol.Column)
End If
End If
Next c
End Function

You may want to add some error checking.

Hth,
Merjet


Hello, I know near to nothing about VBA, would you tell me how to use
your macro?
Thanks in advance,
Armando