Entering from List box

  • Thread starter Thread starter Sheila
  • Start date Start date
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
 
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
 
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
 
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
 
Thanks, thats what I thought it was. Works great, thanks very much.

Sheila
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top