![]() |
![]() |
|
|||||||
| 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 |
|
New Member
Join Date: Apr 2002
Location: Department of Human Services
Posts: 8
|
I have created a combo box in sheet using the control toolbox function and defined the list of surnames. I want to be able to create an "if" statement that looks at the entry selected in the combo box and gives the corresponding address. I have allocated a name to the combo box and used that name in an "if" statement but only get a false result. Any assitance appreciated.
|
|
|
|
|
|
#2 | |
|
MrExcel MVP
Join Date: Feb 2002
Location: The Hague
Posts: 50,319
|
Quote:
where E8 is the LinkedCell and List is the value for ListFillRange. In your case List would be the list of surnames. Hope this helps. [ This Message was edited by: Aladin Akyurek on 2002-05-12 19:19 ] [ This Message was edited by: Aladin Akyurek on 2002-05-12 19:24 ] |
|
|
|
|
|
|
#3 |
|
MrExcel MVP
Join Date: Mar 2002
Location: Michigan USA
Posts: 11,452
|
Hi Aladin:
Wouldn't the linked cell give the index number (i.e the row number of the selected list item -- in that case =index(Namerange,LinkedCell,2) will give surname if the surname is in column 2 of the NameRange Regards! [ This Message was edited by: Yogi Anand on 2002-05-12 20:24 ] |
|
|
|
|
|
#4 | |
|
MrExcel MVP
Join Date: Feb 2002
Location: The Hague
Posts: 50,319
|
Quote:
In the latter case: =VLOOKUP(INDEX(Input-range,Cell-link),Addresses,2,0) would be more appropriate. |
|
|
|
|
|
|
#5 |
|
MrExcel MVP
Join Date: Mar 2002
Location: Michigan USA
Posts: 11,452
|
I reviewed the file emailed to me by PhilJ ...
if the ComboBox is made with View|Toolbars|ControlToolBox -- then linked cell selects the actual item from the list, and the correct formula to use is: =VLOOKUP(LinkedCell,List,2,0) if the ComboBox is made with View|Toolbars|Forms -- then the linked cell selects the index_number of the item, and the correct formula to use is: =INDEX(List,index_number,2) |
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|