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 User Form to display more than 1 reslut

Look at the Excel VBA help example for the findnext command. It shows you
how to find multiple instances of a search string in a range.

--
Regards,
Tom Ogilvy

"EstherJ" wrote in message
...
I have the following function which looks at a list of data when "Cust" -
(customers name) is specified and returns the sales rep and sales value.

The
function finds the first occurence of that name in the list. I would like

it
to display all occurences. I would be grateful for any ideas.


Private Sub Retrieve_Click()
Dim Cust As Range
With Range("Custdata")
Set Cust = .Find(CUstname.Value)
If Cust Is Nothing Then
MsgBox ("Customer not found!")
CUstname.Value = " "
Exit Sub
Else
With Range(Cust.Address)
Salesrep = .Offset(0, 3)
LinevalueGBP = .Offset(0, 16)
End With
End If
End With
End Sub

Thank you,

Esther