Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Is it possible to link a range of cells to a listbox: i.e. when code
executes a show method the list box displays the contents of the linked cells. Bill |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
William,
At design-time you can set the 'RowSource' property of the listbox in the properites window of the listbox to a named range of the Workbook. Or you can do the same at runtime using the listbox's RowSource property, eg., Form1.Listbox1.RowSource = "MyRange" Or, define and name the range at runtime, eg., Range("A1:A10").Name = "MyRange" Form1.Listbox1.RowSource = "MyRange" Form1.Show Or, if you pefer not to name the range (naming the range results in the workbook containing that named range), you can just define the range and fill the listbox item by item, eg., Dim cell As Range For each cell in Range("A1:A10") Form1.Listbox1.AddItem (cell.Value) Next cell Form1.Show HTH, Shockley "William C. Smith" <wcsmithx*xieee.org wrote in message ... Is it possible to link a range of cells to a listbox: i.e. when code executes a show method the list box displays the contents of the linked cells. Bill |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
"shockley" wrote in news:4lnHb.31879$d36.27989
@news01.roc.ny: At design-time you can set the 'RowSource' property of the listbox in the Thank you. I had been to the Properties Window, but how to use it is not obvious. After your help I still had to experiment to find the right way to insert a name in the value field. Help was no help. Again Thank You. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
protect cells after listbox selection | Excel Discussion (Misc queries) | |||
protect cells after listbox selection | Excel Discussion (Misc queries) | |||
listbox.value not equal to listbox.list(listbox.listindex,0) | Excel Programming | |||
Is refreshing listbox rowsource in listbox click event possible? | Excel Programming | |||
Sorting ListBox results or transposing ListBox values to other cells for sorting | Excel Programming |