waimea
10-08-2019, 07:52 AM
I have a userform where I filter things in a listbox that is populated using an array.
I am trying to COUNT values in the array, SUM the values in the array or use SUBTOTAL function.
Myarray = Sheet61.ListObjects("Data").DataBodyRange.Value
The array has 21 columns. And I want to use SUBTOTAL(109, range)on a specific column?
How can I use subtotal formula on the array/listbox/listbox.list?
With ListBox1
.List = Myarray
End With
I think that I should use
Label49.Caption = Application.WorksheetFunction.Subtotal(109, Listbox1.List(i,5))
Where I am not sure on how to get the range in the filterad listbox?
I am trying to COUNT values in the array, SUM the values in the array or use SUBTOTAL function.
Myarray = Sheet61.ListObjects("Data").DataBodyRange.Value
The array has 21 columns. And I want to use SUBTOTAL(109, range)on a specific column?
How can I use subtotal formula on the array/listbox/listbox.list?
With ListBox1
.List = Myarray
End With
I think that I should use
Label49.Caption = Application.WorksheetFunction.Subtotal(109, Listbox1.List(i,5))
Where I am not sure on how to get the range in the filterad listbox?