View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
ben ben is offline
external usenet poster
 
Posts: 232
Default adding multiple columns to a listbox

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.