MrExcel Publishing
Your One Stop for Excel Tips & Solutions

A simple question for you on the Combobox, not for me.


Posted by Craig Crawford on October 12, 1999 4:31 AM

How do i put info from the combobox into a specified cell on the same sheet.


Posted by Chris on October 12, 1999 5:38 AM

I'm assuming that the combobox is on the sheet and not in a userform. If that is the case, you likely have a list that is linked to the combobox to show values. If you right-click the box and choose format control, you can set the cell link. This will show the numerical value of the item selected. If you want the text to be returned, you can do a little lookup formula back to the list feeding the combobox.

You could also do this with a simple macro.

Chris

Posted by Craig Crawford on October 13, 1999 2:55 PM

I Still cant get it to work :(

The combobox is on its own on sheet1.Sheet2 has a list of text addresses in column A(various info on that site in the other columns) and this is what fills the combobox.I want to select an address and have it displayed in a perticular cell on sheet1,and also pull the information on that site into a pre-defined selection of cells.

Ive seen it done before and it looked so easy :(

Posted by Chris on October 14, 1999 5:32 AM

Re: I Still cant get it to work :(

There are a number of ways to accomplish this. Here's the way that is easiest for me to describe. Insert a column before column A on sheet2 and number each of the addresses (starting at 1 of course). Then, right click the combobox and choose Format Control. You should already have the input range picked. Put your cursor in the box for cell link, and choose an empty cell on sheet2.

Now when you pick something in the combobox, a number should appear in the cell you chose as the linked cell. That number will correspond with the numbering in column A. Now you just have to use a VLOOKUP() formula to return the desired values to sheet1.

Something like this will work:
=VLOOKUP(Sheet2!$A$5,Sheet2!$A$6:$C$16,2,0)
Where
Cell Link = Sheet2!$A$5
Range of addresses and other data = Sheet2!$A$6:$C$16
The 2 in the formula means the second column, in this case the address.

HTH,
Chris