Control Toolbox

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

If I link a cell in a combo box in the Forms module and look up the first
item in a range, the linked cell fills in with number 1. If I select the
secong item in the range, number 2 is filled in the linked cell and so on.
How can I get the same result by using the combo box in the control toolbox
menu as it fills in the linked cell with the actual data from the lookup
range rather than numbers 1, 2 etc?
 
You have to MATCH it against the combobox source data in then click event.

--

HTH

RP
(remove nothere from the email address if mailing direct)
 
Hi Bob
Sorry to be a pain

What exactly do you mean "MATCH it against the combobox source and click
event"?
 
I thought you might ask that <vbg>

Say the source data is in Sheet2, cells A2:A20. The combobox returns the
value, so you match against the source,

=MATCH(val,Sheet2!A2:A20,0)

in VBA

Application.MatchCombobox1.Value, Worksheets("Sheet2").Range("A2:A20"), 0)

This would be done within the combobox click event
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top