[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?
Re: designating listview column as an array ...
If I understand you correctly you must have list of numbers in one of your columns (subitems).
If so, what does that list look like? If it is delimited by some character then use Split() function.
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?
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
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... :confused: Sorry.
Can you please explain again what you need to do? Thanks.
Re: designating listview column as an array ...
ok, thanks edgemeal, that works :)