Results 1 to 6 of 6

Thread: [RESOLVED] designating listview column as an array ...

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Mar 2007
    Posts
    272

    Resolved [RESOLVED] designating listview column as an array ...

    Dim ArrNums As Variant

    ArrNums = Array(ListView1.ListItems.Item(1).ListSubItems(21))

    of course this only gets one data point ....

    what is the best way to collect all the data points (numbers) in col 21 of the listview and place it into an array that can be then used to perform the required analysis?

  2. #2

  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    Mar 2007
    Posts
    272

    Re: designating listview column as an array ...

    thanks for the reply

    so what u r saying is to loop through the listview and then comma separate and place that string inside the array parenthesis?

  4. #4
    VB For Fun Edgemeal's Avatar
    Join Date
    Sep 2006
    Location
    WindowFromPoint
    Posts
    4,255

    Re: designating listview column as an array ...

    Not sure I understand, you want to get all items (numbers) from column 21 and put them into an array called ArrNums. ?

    Code:
        Option Explicit
        Dim ArrNums() As Double
    Code:
    Private Sub Command1_Click()
    
        ReDim ArrNums(ListView1.ListItems.Count)
        Dim lvi As Long
        
        For lvi = 1 To ListView1.ListItems.Count
            ArrNums(lvi) = ListView1.ListItems.Item(lvi).ListSubItems(21)
        Next lvi
    
    End Sub

  5. #5
    PowerPoster RhinoBull's Avatar
    Join Date
    Mar 2004
    Location
    New Amsterdam
    Posts
    24,132

    Re: designating listview column as an array ...

    Quote Originally Posted by inosent
    thanks for the reply

    so what u r saying is to loop through the listview and then comma separate and place that string inside the array parenthesis?
    I don't really understand you anymore... Sorry.
    Can you please explain again what you need to do? Thanks.

  6. #6

    Thread Starter
    Hyperactive Member
    Join Date
    Mar 2007
    Posts
    272

    Re: designating listview column as an array ...

    ok, thanks edgemeal, that works

Posting Permissions

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



Click Here to Expand Forum to Full Width