T
Tim at MBS
Hi, I was hoping someone could help me figure out what I am doing wrong.
I have a list box set up on a worksheet and I want the user to select a
value from the list box, and then have that value entered into a cell when a
button is clicked.
When I run/step through the macro, it takes a value and places it into the
appropriate cell. The problem is that the value which is placed in the cell
is not the value from the listbox, but the row number of the value that was
chosen. Using the below row numbers and values as an example; if I select
value 7 from the list box, the value that is returned is 2, not 7. If I
select 9A, the value returned is 4. The listbox value range is on different
worksheet than the worksheet where I want to place the listbox value. The
listbox range is currently one column with about 200 rows.
Worksheet Row Number Value
1 6
2 7
3 8
4 9A
5 10B
The condensed version of the code (excluding how I choose the cell) is:
Dim listvalue As String
Dim rowcounter As Integer
Dim EOBpointer As Range
Worksheets("Timer").Activate
ActiveSheet.Shapes("List Box 8").Select
rowcounter = 35
listvalue = Selection.Value
Set EOBpointer = Range("c" & rowcounter)
EOBpointer.Select
Selection.Value = listvalue
I have a list box set up on a worksheet and I want the user to select a
value from the list box, and then have that value entered into a cell when a
button is clicked.
When I run/step through the macro, it takes a value and places it into the
appropriate cell. The problem is that the value which is placed in the cell
is not the value from the listbox, but the row number of the value that was
chosen. Using the below row numbers and values as an example; if I select
value 7 from the list box, the value that is returned is 2, not 7. If I
select 9A, the value returned is 4. The listbox value range is on different
worksheet than the worksheet where I want to place the listbox value. The
listbox range is currently one column with about 200 rows.
Worksheet Row Number Value
1 6
2 7
3 8
4 9A
5 10B
The condensed version of the code (excluding how I choose the cell) is:
Dim listvalue As String
Dim rowcounter As Integer
Dim EOBpointer As Range
Worksheets("Timer").Activate
ActiveSheet.Shapes("List Box 8").Select
rowcounter = 35
listvalue = Selection.Value
Set EOBpointer = Range("c" & rowcounter)
EOBpointer.Select
Selection.Value = listvalue