ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Entering from List box (https://www.excelbanter.com/excel-worksheet-functions/27123-entering-list-box.html)

Sheila

Entering from List box
 
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

Sheila

Sorry, make that a combo box, not a list box.

Sheila



On Sat, 21 May 2005 12:03:40 +1200, Sheila
(remove underscores) wrote:

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



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



"Sheila" (remove underscores) wrote in message
...
Sorry, make that a combo box, not a list box.

Sheila



On Sat, 21 May 2005 12:03:40 +1200, Sheila
(remove underscores) wrote:

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





[email protected]

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



Mangesh wrote:
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



"Sheila" (remove underscores) wrote in

message
...
Sorry, make that a combo box, not a list box.

Sheila






On Sat, 21 May 2005 12:03:40 +1200, Sheila
(remove underscores) wrote:

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




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


wrote in message
ups.com...
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



Mangesh wrote:
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



"Sheila" (remove underscores) wrote in

message
...
Sorry, make that a combo box, not a list box.

Sheila






On Sat, 21 May 2005 12:03:40 +1200, Sheila
(remove underscores) wrote:

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





Sheila

Thanks, thats what I thought it was. Works great, thanks very much.

Sheila


Mangesh

Hi Sheila,

Thanks for the feedback.

Mangesh


"Sheila" wrote in message
oups.com...
Thanks, thats what I thought it was. Works great, thanks very much.

Sheila





All times are GMT +1. The time now is 05:18 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com