I am struggling populating a listview, I have never used them before.
I can populate one column, but I am struggling to populate the next column.
This is what I have:
With ListView1
.View = lvwReport
.FullRowSelect = True
.Gridlines = True
With .ColumnHeaders
.Clear
.Add , , "Language", 70
.Add , , "Language", 70
.Add , , "Language", 70
End With
End With
Set sh = ThisWorkbook.Worksheets(4)
With sh
LR = .Range("A" & .Rows.Count).End(xlUp).row
End With
lC = 0
For r = 2 To LR
Set li = ListView1.ListItems.Add
li.ListSubItems.Add , , sh.Cells(r, 4).Value
Next
I thought I could just add an extra
Set li = ListView1.ListItems.Add
li.ListSubItems.Add , , sh.Cells(r, 5).Value
But this just appends the first column.
Thanks
I think you need to use:
And then move on with your ListSubItems. Have a look here and scroll down. Some nice examples.