Results 1 to 2 of 2
  1. #1
    Gold Lounger
    Join Date
    Jan 2004
    Location
    Italy
    Posts
    3,245
    Thanks
    0
    Thanked 0 Times in 0 Posts
    the code not fill the item in lsitview1.......!!!!!!!!!!!!!

    My code:

    Sub FILL_LISTVIEW()

    Dim i As Integer
    Dim s As String
    Dim lst As ListItem, lst1 As ListSubItem, row As Integer, col As Integer
    Dim WS As Worksheet

    Set WS = Sheets("DATA_BASE")

    ListView1.View = lvwReport
    ListView1.ColumnHeaders.Add , , "DATA", 50
    ListView1.ColumnHeaders.Add , , "NOMINATIVO", 215
    ListView1.ColumnHeaders.Add , , "DIVISA", 40
    ListView1.ColumnHeaders.Add , , "IMPORTO", 100
    ListView1.ColumnHeaders.Add , , "TIPO", 30

    row = 2
    col = 1

    For Each lst In ListView1.ListItems
    col = 1
    WS.Cells(row, col) = lst.Text
    col = col + 1
    For Each lst1 In lst.ListSubItems
    WS.Cells(row, col) = lst1.Text
    col = col + 1
    Next
    row = row + 1
    Next

    End Sub

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts
    This code doesn't populate the listview. The For Each ... Next part assumes that the listview has already been filled and copies values from the listview to the worksheet.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •