K
KL
Hi there,
I am using the following code to populate a listbox with
multiple-column entries. My problem is I can't find a way
to populate the columns' headers too. Any ideas muchly
appreciated.
KL
-------------Code Start--------------
Dim MyArray()
Private Sub UserForm_Initialize()
Dim r As Single
cCounter = Sheets("DBASE").UsedRange.Columns.Count - 1
rCounter = Sheets("DBASE").UsedRange.Rows.Count - 1
ReDim MyArray(rCounter, cCounter)
lb1.ColumnCount = cCounter + 1
'Load values MyArray
For r = 0 To rCounter
For c = 0 To cCounter
MyArray(r, c) = Sheets
("DATABASE").UsedRange.Cells(r + 2, c + 1)
Next c
Next r
'Load ListBox1
lb1.List() = MyArray
End Sub
-------------Code Start--------------
I am using the following code to populate a listbox with
multiple-column entries. My problem is I can't find a way
to populate the columns' headers too. Any ideas muchly
appreciated.
KL
-------------Code Start--------------
Dim MyArray()
Private Sub UserForm_Initialize()
Dim r As Single
cCounter = Sheets("DBASE").UsedRange.Columns.Count - 1
rCounter = Sheets("DBASE").UsedRange.Rows.Count - 1
ReDim MyArray(rCounter, cCounter)
lb1.ColumnCount = cCounter + 1
'Load values MyArray
For r = 0 To rCounter
For c = 0 To cCounter
MyArray(r, c) = Sheets
("DATABASE").UsedRange.Cells(r + 2, c + 1)
Next c
Next r
'Load ListBox1
lb1.List() = MyArray
End Sub
-------------Code Start--------------