Hi,
Dim myArray(54,100) as Sting
Can I count the number of items in the second dimension of my array...?
without looping through all 100 possible values and checking to see if they
are not nulll...
thanks
Simon Shaw
Hi,
Dim myArray(54,100) as Sting
Can I count the number of items in the second dimension of my array...?
without looping through all 100 possible values and checking to see if they
are not nulll...
thanks
Simon Shaw
What do you mean by the second dimension of the array. Each row has 100
columns. Each column has 54 rows. What are you trying to check?
--
Regards,
Tom Ogilvy
"Simon Shaw" <simonATsimonstoolsDOTcom> wrote in message
news:[email protected]...
> Hi,
>
> Dim myArray(54,100) as Sting
>
> Can I count the number of items in the second dimension of my array...?
> without looping through all 100 possible values and checking to see if
they
> are not nulll...
>
> thanks
>
> Simon Shaw
>
I am storing user selection lists from a ListBox in the Array:
myArray(Filter_Number, Selected_Items)
where the max filters are 54 and the max selected items is 100.
Usually the user will select less than 100 items say 10 items for say filter
1, how can I count the 10 items of the selected_items without looping through
the array to see if items have been stored?
I want to avoid:
for i = 1 to 100
if myArray(1, i).value <> "" then _
count = count + 1
next i
"Tom Ogilvy" wrote:
> What do you mean by the second dimension of the array. Each row has 100
> columns. Each column has 54 rows. What are you trying to check?
>
> --
> Regards,
> Tom Ogilvy
>
> "Simon Shaw" <simonATsimonstoolsDOTcom> wrote in message
> news:[email protected]...
> > Hi,
> >
> > Dim myArray(54,100) as Sting
> >
> > Can I count the number of items in the second dimension of my array...?
> > without looping through all 100 possible values and checking to see if
> they
> > are not nulll...
> >
> > thanks
> >
> > Simon Shaw
> >
>
>
>
This counts the number of values a row at a time.
Sub ABC()
Dim v(1 To 54, 1 To 100)
Dim v1 as Variant
For i = 1 To 10
For j = 1 To 10
v(Int(Rnd() * 54 + 1), Int(Rnd() * 100 + 1)) = i * j
Next
Next
For i = 1 To 54
v1 = Application.Index(v, i, 0)
Debug.Print i, Application.Count(v1)
Next
End Sub
If the array elements would be alphanumeric, use countA
--
Regards,
Tom Ogilvy
"Simon Shaw" <simonATsimonstoolsDOTcom> wrote in message
news:[email protected]...
> I am storing user selection lists from a ListBox in the Array:
> myArray(Filter_Number, Selected_Items)
> where the max filters are 54 and the max selected items is 100.
> Usually the user will select less than 100 items say 10 items for say
filter
> 1, how can I count the 10 items of the selected_items without looping
through
> the array to see if items have been stored?
>
> I want to avoid:
>
> for i = 1 to 100
> if myArray(1, i).value <> "" then _
> count = count + 1
> next i
>
> "Tom Ogilvy" wrote:
>
> > What do you mean by the second dimension of the array. Each row has 100
> > columns. Each column has 54 rows. What are you trying to check?
> >
> > --
> > Regards,
> > Tom Ogilvy
> >
> > "Simon Shaw" <simonATsimonstoolsDOTcom> wrote in message
> > news:[email protected]...
> > > Hi,
> > >
> > > Dim myArray(54,100) as Sting
> > >
> > > Can I count the number of items in the second dimension of my
array...?
> > > without looping through all 100 possible values and checking to see if
> > they
> > > are not nulll...
> > >
> > > thanks
> > >
> > > Simon Shaw
> > >
> >
> >
> >
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks