simora
04-28-2013, 01:46 AM
I'm trying to add ListItems from a Dynamic range to a Listview.
This is the code that I have.
Private Sub UserForm_Initialize()
' To fill ListView1 with content from a worksheet range
Sheets("Sheet1").Activate
With ListView1
.View = lvwReport
With .ColumnHeaders
.Clear
.Add , , "Account #", 100
.Add , , " Name", 150
.Add , , " Total", 80
End With
.ListItems.Add , , Sheets(1).Range(Range("A2"), Range("C65536").End(xlUp))
.HideColumnHeaders = False
.Appearance = cc3D
.FullRowSelect = True
End With
End Sub
It works when I add just 1 item in Col A, but I want to add all the data in the range from Col A to the last used row in column C .
Cant seem to find good info on Listview. Any help appreciated.
Thanks
This is the code that I have.
Private Sub UserForm_Initialize()
' To fill ListView1 with content from a worksheet range
Sheets("Sheet1").Activate
With ListView1
.View = lvwReport
With .ColumnHeaders
.Clear
.Add , , "Account #", 100
.Add , , " Name", 150
.Add , , " Total", 80
End With
.ListItems.Add , , Sheets(1).Range(Range("A2"), Range("C65536").End(xlUp))
.HideColumnHeaders = False
.Appearance = cc3D
.FullRowSelect = True
End With
End Sub
It works when I add just 1 item in Col A, but I want to add all the data in the range from Col A to the last used row in column C .
Cant seem to find good info on Listview. Any help appreciated.
Thanks