Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Getting VB List Box Selections to show in an excel spreadsheet cel

Hello,

I am building a VBA code in Excel 2003 and am having trouble with what I
thought was a relatively basic task. I have created a list box with values
that can be selected. I am trying to program the code so that when a user
selects an item from the drop down item, the value appears in a spreadsheet
cell. The list box is called "ClientList." It is located in a spreadsheet
called "Control Page" I am trying to get the selected value from the List
Box to appear in cell A2 of another worksheet in the book called
"Performance." I have tried all of the following codes, but when I run the
macro, cell A2 does not show anything. Please help!!

Worksheets("Performance").Range("A2").Value = ClientList.Value
Worksheets("Performance").Range("A2").Value = ClientList.Text
ws.Cells(2, 1).Value = Me.ClientList.Value

None of these work. The only thing that happens is with the third.
However, here, the only response is a number corresponding to the list item
that appears in the same sheet at the List Box (i.e. Control Page)
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,391
Default Getting VB List Box Selections to show in an excel spreadsheet cel

Use a combo box from the Control Toolbox rather than from Forms. That way
you get an ActiveX control instead.
Then set the LinkedCell property of the combo box from the properties dialog
(right-click the control and select "Properties") to "Performance!A2",
without the quotes.
Set the ListFillRange to the values to fill the combo box.

NickHK

"MBA Needs Help with Excel VBE" <MBA Needs Help with Excel
wrote in message
...
Hello,

I am building a VBA code in Excel 2003 and am having trouble with what I
thought was a relatively basic task. I have created a list box with

values
that can be selected. I am trying to program the code so that when a user
selects an item from the drop down item, the value appears in a

spreadsheet
cell. The list box is called "ClientList." It is located in a

spreadsheet
called "Control Page" I am trying to get the selected value from the List
Box to appear in cell A2 of another worksheet in the book called
"Performance." I have tried all of the following codes, but when I run

the
macro, cell A2 does not show anything. Please help!!

Worksheets("Performance").Range("A2").Value = ClientList.Value
Worksheets("Performance").Range("A2").Value = ClientList.Text
ws.Cells(2, 1).Value = Me.ClientList.Value

None of these work. The only thing that happens is with the third.
However, here, the only response is a number corresponding to the list

item
that appears in the same sheet at the List Box (i.e. Control Page)



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Getting VB List Box Selections to show in an excel spreadsheet

Nick,
Thank you for your speedy message. I can tell right off that the control
toolbox is much better. I have one follow up question. In my original code,
I had it set up so that they pressed a "Get Report" button and that opened
the form and allowed you to select an item from the list and then to click on
a button (with a macro behind it) that produced the report. Is there a way
to set up something similar to this but with using ActiveX

"NickHK" wrote:

Use a combo box from the Control Toolbox rather than from Forms. That way
you get an ActiveX control instead.
Then set the LinkedCell property of the combo box from the properties dialog
(right-click the control and select "Properties") to "Performance!A2",
without the quotes.
Set the ListFillRange to the values to fill the combo box.

NickHK

"MBA Needs Help with Excel VBE" <MBA Needs Help with Excel
wrote in message
...
Hello,

I am building a VBA code in Excel 2003 and am having trouble with what I
thought was a relatively basic task. I have created a list box with

values
that can be selected. I am trying to program the code so that when a user
selects an item from the drop down item, the value appears in a

spreadsheet
cell. The list box is called "ClientList." It is located in a

spreadsheet
called "Control Page" I am trying to get the selected value from the List
Box to appear in cell A2 of another worksheet in the book called
"Performance." I have tried all of the following codes, but when I run

the
macro, cell A2 does not show anything. Please help!!

Worksheets("Performance").Range("A2").Value = ClientList.Value
Worksheets("Performance").Range("A2").Value = ClientList.Text
ws.Cells(2, 1).Value = Me.ClientList.Value

None of these work. The only thing that happens is with the third.
However, here, the only response is a number corresponding to the list

item
that appears in the same sheet at the List Box (i.e. Control Page)




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,391
Default Getting VB List Box Selections to show in an excel spreadsheet

These ActiveX controls have events; different controls, different events,
although there is some commonality amongst them.
The easiest way to start is to right-click the control and select "View
Code". You will see you have a routine stub something like:

Private Sub CommandButton1_Click()

End Sub

and above the code pane, you will see that at the top left, the combo box
shows "CommandButton1" and the top-right shows "Click".
Select the various items in the top-right combo box to see the various
events that the control in the left combo box exposes. You will get the stub
created for you for each event you select.

NickHK

"MBA Needs Help with Excel VBE"
m wrote in message
...
Nick,
Thank you for your speedy message. I can tell right off that the control
toolbox is much better. I have one follow up question. In my original

code,
I had it set up so that they pressed a "Get Report" button and that opened
the form and allowed you to select an item from the list and then to click

on
a button (with a macro behind it) that produced the report. Is there a

way
to set up something similar to this but with using ActiveX

"NickHK" wrote:

Use a combo box from the Control Toolbox rather than from Forms. That

way
you get an ActiveX control instead.
Then set the LinkedCell property of the combo box from the properties

dialog
(right-click the control and select "Properties") to "Performance!A2",
without the quotes.
Set the ListFillRange to the values to fill the combo box.

NickHK

"MBA Needs Help with Excel VBE" <MBA Needs Help with Excel
wrote in message
...
Hello,

I am building a VBA code in Excel 2003 and am having trouble with what

I
thought was a relatively basic task. I have created a list box with

values
that can be selected. I am trying to program the code so that when a

user
selects an item from the drop down item, the value appears in a

spreadsheet
cell. The list box is called "ClientList." It is located in a

spreadsheet
called "Control Page" I am trying to get the selected value from the

List
Box to appear in cell A2 of another worksheet in the book called
"Performance." I have tried all of the following codes, but when I

run
the
macro, cell A2 does not show anything. Please help!!

Worksheets("Performance").Range("A2").Value = ClientList.Value
Worksheets("Performance").Range("A2").Value = ClientList.Text
ws.Cells(2, 1).Value = Me.ClientList.Value

None of these work. The only thing that happens is with the third.
However, here, the only response is a number corresponding to the list

item
that appears in the same sheet at the List Box (i.e. Control Page)






Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Excel--Can you select multiple selections in a drop down list? Nukeman Excel Discussion (Misc queries) 3 February 10th 09 09:51 AM
Excel: Can you allow multiple selections from one list box? tonia_b3 Excel Discussion (Misc queries) 3 February 21st 06 04:32 PM
Multiple selections from a drop down list in Excel... JMW Excel Worksheet Functions 3 November 9th 05 05:05 PM
Row selections by row # OR by even/odd rows in another spreadsheet Tom Excel Discussion (Misc queries) 0 February 9th 05 04:03 PM
How to Make Multiple List Box Selections Populate A Column in Excel Excel Nerd Excel Programming 1 January 23rd 04 12:46 AM


All times are GMT +1. The time now is 04:23 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"