Admin
Below is my code to fill the ListBox - Guess my approach to reading values into the ListBox is very crude - however if I set 'LastRow=10' then it all works - in terms of being able to fill the ListBox
PcMax - ok - so the max is 30 columns - I was using ListView - but it is unstable - I had to change a bunch of ListView objecxts to ListBoxes - major pain.
Code:
With Worksheets("testing").UsedRange
LastRow = .Rows(.Rows.Count).Row
ColLast = .Columns(.Columns.Count).Column
'LastRow = 10
End With
With ListBox1
.ColumnCount = LastRow
.ListStyle = 1
.MultiSelect = 1
.Clear
For ii = 1 To ColLast
.AddItem Worksheets("testing").Cells(1, ii).Value
For i = 2 To LastRow
.List(ii - 1, i - 1) = Worksheets("testing").Cells(i, ii).Value
Next i
Next ii
End With
Bookmarks