Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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) |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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) . |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Kevin,
Great code! Just let you know a typing error. :-) Change "End" before "Next ndex" to "End If". Colo "Kevin Beckham" wrote in message ... 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) . |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Runtime | Excel Discussion (Misc queries) | |||
Runtime error | Excel Discussion (Misc queries) | |||
Creating controls to autofill a form | Excel Discussion (Misc queries) | |||
Assigning events to runtime-created controls - is it possible? | Excel Discussion (Misc queries) | |||
ActiveX Controls vs Form Controls | Excel Discussion (Misc queries) |