Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have a UserForm with various ComboBoxes and Labels. At the click of a
CommandButton, I would like to add these items to 7 different columns in a listbox. The comboboxes and labels will then go blank to be filled in again and when the CommandButton is clicked again the list box adds another row with the new items, and so on. Do I have to use an array for this or just additem/list. Please help. |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
first thing set column count
mylistbox.columncount = 9 9 is max then to setvalues mylistbox.list(rownumber,columnnuber) = "mydata1" mylistbox.list(rownumber,columnnuber) = "mydata2" mylistbox.list(rownumber,columnnuber) = "mydata2" mylistbox.list(rownumber,columnnuber) = "mydata2" etc.... note rownumber and columnnumber start at 0 ben -- When you lose your mind, you free your life. "ndm berry" wrote: I have a UserForm with various ComboBoxes and Labels. At the click of a CommandButton, I would like to add these items to 7 different columns in a listbox. The comboboxes and labels will then go blank to be filled in again and when the CommandButton is clicked again the list box adds another row with the new items, and so on. Do I have to use an array for this or just additem/list. Please help. |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thanks for the help Ben.
Dim rowNumber, columnNumber ListBox1.ColumnCount = 7 ListBox1.List(rowNumber, columnNumber) = ComboBoxClt ListBox1.List(rowNumber, columnNumber) = LabelCltNme ListBox1.List(rowNumber, columnNumber) = ComboBoxWrk ListBox1.List(rowNumber, columnNumber) = LabelWrkNme ListBox1.List(rowNumber, columnNumber) = ComboBoxYr ListBox1.List(rowNumber, columnNumber) = TextBoxTme ListBox1.List(rowNumber, columnNumber) = TextBoxNtv I get an error message saying "Could not set the list property. Invalid property array index". I'm sure I have misunderstood what you meant. "ben" wrote: first thing set column count mylistbox.columncount = 9 9 is max then to setvalues mylistbox.list(rownumber,columnnuber) = "mydata1" mylistbox.list(rownumber,columnnuber) = "mydata2" mylistbox.list(rownumber,columnnuber) = "mydata2" mylistbox.list(rownumber,columnnuber) = "mydata2" etc.... note rownumber and columnnumber start at 0 ben -- When you lose your mind, you free your life. "ndm berry" wrote: I have a UserForm with various ComboBoxes and Labels. At the click of a CommandButton, I would like to add these items to 7 different columns in a listbox. The comboboxes and labels will then go blank to be filled in again and when the CommandButton is clicked again the list box adds another row with the new items, and so on. Do I have to use an array for this or just additem/list. Please help. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Adding items to columns in a listbox | Excel Discussion (Misc queries) | |||
multiple columns / rows to be referenced through a listbox | Excel Discussion (Misc queries) | |||
Selecting multiple items and columns from ListBox | Excel Programming | |||
Multi-column ListBox. Multiple bound columns??? | Excel Programming | |||
Transfer multiple columns items form listbox to range | Excel Programming |