Hello everyone,
I'm trying to display all data from my sheet to a listview in an userform. However, I can't get all rows but only a limit of ~50 in the listview. If I set "For i = 1 to 500" for example, I have a message error ("type mismatch"). I have the following code :
How can I get all row until last row?
Thank you for your help!
I'm trying to display all data from my sheet to a listview in an userform. However, I can't get all rows but only a limit of ~50 in the listview. If I set "For i = 1 to 500" for example, I have a message error ("type mismatch"). I have the following code :
How can I get all row until last row?
Private Sub UserForm_Initialize() Dim ws As Worksheet Dim rg As Range Dim i As Long Dim j As Long Set ws = ThisWorkbook.Sheets("Transposition") Set rg = ws.Range("ReferenceTab") With UserForm1.ListView1 'get column 1 to 12 For i = 1 To 12 .ColumnHeaders.Add , , rg.Offset(0, i - 1) Next i 'get row 1 to 48 For i = 1 To 48 .ListItems.Add , , rg.Offset(i, 0) Next i For i = 1 To 48 For j = 1 To 11 .ListItems(i).ListSubItems.Add , , rg.Offset(i, j) Next j Next i .View = lvwReport End With End Sub |
Thank you for your help!