EXCEL copy combobox value into a cell

angku -  
 Hugobill -
Hello,

My question is simple, I would like to know how to copy the value of a combobox into a cell.

That's all ^^

Thank you in advance

4 réponses

hich24 Posted messages 1686 Status Membre 753
 
In VBA, you double-click on the ComboBox

Private Sub ComboBox1_Change()
Range("A1").Value = ComboBox1.Value
End Sub

You can replace A1 with the cell of your choice.
15
Laetz
 
Hello....how do we copy the values from an Excel cell into a combobox????

And it should additionally take all the values present in that column...


Let me explain more clearly....The user selects a food item in a combobox and by clicking on an order button, this value will be displayed on the "menu" tab of Excel. And I want to retrieve this value to put it in a combobox.....Help me, it's super urgent...Thank you
0
hich24 Posted messages 1686 Status Membre 753
 
1- right-click on the combobox > properties > look for "ListFillRange"
enter the name of the sheet and the column
e.g. menu!A1:A20

the exclamation point is important
1
Laetz
 
Yeah, but the problem is that there's a different tab for each type of food, and they aren't all equal in terms of the number of lines... And since we can add lines at any time, well, there you go...
0
hich24 Posted messages 1686 Status Membre 753
 
It is enough to give a larger number menu!A1:A500
1
Hugobill
 

Where to create ranges with Offset https://excel-bytes.com/how-to-create-a-dynamic-range-for-a-data-validation-list-with-offset-in-excel/

0
angku
 
Thank you :)
0
hich24 Posted messages 1686 Status Membre 753
 
at your service
0