View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Pierre[_18_] Pierre[_18_] is offline
external usenet poster
 
Posts: 19
Default choos one of two comboboxes

Hi,

I have a userform with two comboboxes.
the first one lists the customer name
the second one lists the customer advisor

Depending on which combobox the user selects, i want to use the value the
user selects to pick the customer form the data sheet.
I managed to do it for one combobox using a "retrieve" button called
"ophalen" like this;

Private Sub but_ophalen_Click()
Dim klantkeuze As String
Dim naamtotaal As String
klantkeuze = zoekwg.Value
Set klantmatrix = Worksheets("datadga").Range("B2:b500").Find(klantk euze)
txt_naamwg = Worksheets("datadga").Cells(klantmatrix.Row,
klantmatrix.Column)
etc..
end sub

where
zoekwg = a combobox

My question,
How can i get my form to use either combobox 1 or 2 depending on which
combobox the user chooses ?

I can only imagine a second button for combobox 2 but there must be a more
elegant solution i think?
Please help me.
Pierre