Entering from List box

S

Sheila

I have a range of data that I wish to use a list box so that the data
of choice is entered into the cell I am clicked into. IE, if i am in
cell B2 and I select from the list box "Product 2), I wish that data
(Product 2) to be entered into B2. How can I do that?

TIA

Sheila
 
M

Mangesh

You could have the code in the onchange event for the combo-box

Private Sub ComboBox1_Change()
ActiveCell.Value = ComboBox1.Value
End Sub

I assume that you first select a cell where you want the value of the
combobox to go. If not (i.e. you want it to go to a particular cell), then
you could change the line to:
Range("B2") = ComboBox1.Value

Mangesh
 
W

wayneflint

Thanks Mangesh, it works just fine (I think), but what do you mean by
having the code in the onchange event for the combo box? where is
that?

TIA
sheila
 
M

Mangesh

I assume you are using a combobox for the purpose. Select the combo-box
(design mode is ON). Double click to view the VB editor where you could
enter the code for the combobox

Mangesh
 
Top