Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Set cell value in Excel with vaule from Combo Box.

Status
Not open for further replies.

Channah

IS-IT--Management
Jan 16, 2003
38
US
I have a Combo Box in my Excel sheet that I would like to have auto-populate other cell below it. Any ideas?

 
Hi,

Are you using a Form combobox or Toolbox combobox?

With the latter, in the Combobox1_Change event...
Code:
  with combobox1
    .topleftcell.offset(2,0).value=.value
  end with
assuming that the cell you want to populate is 2 rows below the cell at the top left corner of the combobox.

:)

Skip,
Skip@TheOfficeExperts.com
 
I have the combobox adding a value to the cell. Unfottunately it is adding the list position number of the value... for example: It is displaying 1 instead of Excel. I need it to display Excel. Also it is a Form Combo Box.

Thanks
 
If you were to use the toolbox control, it would do that.

The number in the cell is the list index. so you can take the list index and lookup the value using the INDEX function.
Code:
=INDEX(YourList,ListIndex,1)
If you set the ListFillRange and LinkedCell in the toolbox combobox, you'll get the value instead of the list index ;-)

Skip,
Skip@TheOfficeExperts.com
 
Thanks but I am still lost on this one. I rarely use excel for this type of thing. I cannot get the index number to go away. I have tried to use the Index function as above but I am going to have to claim ignorance on this one. Any further detail would be greatly appreciated. Thanks
 
Using a combobox from the Forms menu, you cannot get the list index (cell link) to go away. You have to use the list index to get the corresponding list text.

Example -- assume a list in col a

apple
lemon
orange

your combobox cell link is in B1 and has a value of 2

your formula is is C1
=INDEX(A1:A3,B1,1) and the value is lemon

does this help?

Skip,
Skip@TheOfficeExperts.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top