ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Capture listbox selection to a cell in a different sheet (https://www.excelbanter.com/excel-programming/277506-capture-listbox-selection-cell-different-sheet.html)

Marcie

Capture listbox selection to a cell in a different sheet
 
Basically I have an input/user sheet, an output sheet. The user makes a
selection from a listbox in the Input sheet, and I need what was
selected to be put in a cell in the Output sheet. Anyone know how to
do this? I've done this just doing cell to cell. That would be
"=input!A2" but I'm not sure how to do it for a listbox selection.
Thanks in advance.

Also, does anyone know how to get rid of the horizontal scrollbar that
automatically comes up with a listbox. Its not needed, and I cant
figure out how to get rid of it. Something about changing the "width"
under "properties" in the control toolbox.



------------------------------------------------
~~ Message posted from http://www.ExcelTip.com/
~~ View and post usenet messages directly from http://www.ExcelForum.com/


Spammastergrand

Capture listbox selection to a cell in a different sheet
 
I usually use comboboxes instead of listboxes. You can use a click even to
populate a range in another cell.

like

Private Sub ComboBox1_Change()
sheets("output").range("A2").value = combobox1.value

End Sub


Tom Ogilvy

Capture listbox selection to a cell in a different sheet
 
Set the linkedcell property of the listbox to the cell where you want the
selection to appear

Make the control toolbox toolbar visible and click the upper left icon so it
appears depressed. This puts you in design mode where you can change the
properties of the listbox. Right click on the listbox and select
properties. One of the properties should be LinkedCell. Put in an entry
like Output!B9

Also, another property is Width. Make the number larger.

--
Regards,
Tom Ogilvy

Marcie wrote in message
...
Basically I have an input/user sheet, an output sheet. The user makes a
selection from a listbox in the Input sheet, and I need what was
selected to be put in a cell in the Output sheet. Anyone know how to
do this? I've done this just doing cell to cell. That would be
"=input!A2" but I'm not sure how to do it for a listbox selection.
Thanks in advance.

Also, does anyone know how to get rid of the horizontal scrollbar that
automatically comes up with a listbox. Its not needed, and I cant
figure out how to get rid of it. Something about changing the "width"
under "properties" in the control toolbox.



------------------------------------------------
~~ Message posted from http://www.ExcelTip.com/
~~ View and post usenet messages directly from http://www.ExcelForum.com/





All times are GMT +1. The time now is 10:37 AM.

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