I'm displaying set of range values in two list boxes using VBA form. In listbox1 headers, then per input displaying relevant data in listbox2 by using the below code:
'header
Set rng = sht.Range("A1:I1")
With ListBox1
.ColumnCount = 9
.ColumnWidths = "50;40;30;120;160;120;50;30;30"
.RowSource = rng.Address
End With
'dynamic data
Set rng1 = sht.Range(Cells(st, ukey), Cells(st + en - 1, utim))
With ListBox2
.ColumnCount = 9
.ColumnWidths = "50;40;30;120;160;120;50;30;30"
.RowSource = rng1.Address
End With
How can I add the header and data in one listbox after the heading?
Also how can I add column 10 to 15 in the listbox from another set of ranges?
