![]() |
![]() |
|
|||||||
| Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Join Date: Apr 2002
Location: NSW. Australia
Posts: 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 |
|
|
|
|
|
#2 | |
|
MrExcel MVP
Join Date: Feb 2002
Location: Auckland, New Zealand
Posts: 4,208
|
Quote:
ie. A1 start B1 details and label = Label1 is; Private Sub ComboBox1_Change() Label1.Caption = Cells(ComboBox1.ListIndex + 1, 2) End Sub |
|
|
|
|
|
|
#3 |
|
Join Date: Apr 2002
Location: NSW. Australia
Posts: 64
|
Thanks Ivan
Your code worked but how do I get it to take the values from the "Client Details" Sheet? |
|
|
|
|
|
#4 |
|
MrExcel MVP
Join Date: Feb 2002
Location: Auckland, New Zealand
Posts: 4,208
|
Private Sub ComboBox1_Change() Label1.Caption = Sheets("Client Details").Cells(ComboBox1.ListIndex + 1, 2) End Sub |
|
|
|
|
|
#5 |
|
Join Date: Apr 2002
Location: NSW. Australia
Posts: 64
|
Thanks again Ivan. Greatly appreciated.
|
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|