View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Kevin Beckham Kevin Beckham is offline
external usenet poster
 
Posts: 78
Default creating controls at runtime

The normal ListBox will solve both questions
- to get the checkboxes, set the ListStyle to
fmListStyleOption
- to allow multiple selections, set MultiSelect to
fmMultiSelectMulti
- to get multiple columns, set ColumnCount to the number
you need
-- to add an entry, use something like..
With Me.lbxCompare
.AddItem value_1
.List(.ListCount -1, 1) = value_2
.List(.ListCount -1, 2) = value_3
End With

- note that List is dimensioned from 0 across and down
- to determine whether a line is checked then use

With Me.lbxCompare
For ndex = 0 to .ListCount - 1
If .Selected(ndex) Then
'do something about it
End
Next ndex
End With

Kevin Beckham

-----Original Message-----
Is there a way to create an array of controls during
runtime? The program I'm developing will compare 2 files
and put discrepancies in a listbox. For each entry, I
would like a checkbox developed (preferably in the

listbox
though I don't think that's possible) The user can then
checkmark the discrepancies he/she wants to update. The
amount of entries in the listbox (and the number of
checkboxes) will vary each time the program is run.

Also, related: is there a way to grid out the listbox to
show multiple rows and columns? (making it look similar
to an excel spreadsheet)
.