Combo Box

Phil C

Board Regular
Joined
Apr 10, 2002
Messages
64
I have a combo box on a form that looks up values from a sheet. What I need to setup is a label that when the user selects an entry from the combo box a corresponding cell entry is placed in the label. i.e. if the user selects the first name which originates in cell A1 on sheet 'client details' then the contents of cell B1 from 'client details' would be returned to the label.
I know how to get the label to look up details from a sheet but I don't know how to make it dependent on a combo box entry or if it is possible.

Thanks in advance
 

Excel Facts

Ambidextrous Undo
Undo last command with Ctrl+Z or Alt+Backspace. If you use the Undo icon in the QAT, open the drop-down arrow to undo up to 100 steps.
On 2002-05-07 01:55, Phil C wrote:
I have a combo box on a form that looks up values from a sheet. What I need to setup is a label that when the user selects an entry from the combo box a corresponding cell entry is placed in the label. i.e. if the user selects the first name which originates in cell A1 on sheet 'client details' then the contents of cell B1 from 'client details' would be returned to the label.
I know how to get the label to look up details from a sheet but I don't know how to make it dependent on a combo box entry or if it is possible.

Thanks in advance

One way to do this given your info
ie. A1 start B1 details and label = Label1
is;

Private Sub ComboBox1_Change()
Label1.Caption = Cells(ComboBox1.ListIndex + 1, 2)
End Sub
 
Upvote 0
Thanks Ivan
Your code worked but how do I get it to take the values from the "Client Details" Sheet?
 
Upvote 0
<pre/>
Private Sub ComboBox1_Change()
Label1.Caption = Sheets("Client Details").Cells(ComboBox1.ListIndex + 1, 2)
End Sub
</pre>
 
Upvote 0

Forum statistics

Threads
1,214,979
Messages
6,122,561
Members
449,089
Latest member
Motoracer88

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top