Hi all,
I have filled a 2d array with values - can i find out the size of the array WHERE Arry(1, i) = 'WB01' - for example.
TIA
Hi all,
I have filled a 2d array with values - can i find out the size of the array WHERE Arry(1, i) = 'WB01' - for example.
TIA
Are you asking how to count the number of occurances where the array contains "WB01"
regards
yes i am,
suppose I would just loop through the entire array and set up a count where array = 'WB01' - thought I might just be able to use ubound with a criteria set on it?
UBound(Arry,1)
and
UBound(Arry,2)
for the two dimensions of the array
--
HTH
Bob Phillips
(remove nothere from email address if mailing direct)
"gti_jobert" <[email protected]> wrote
in message news:[email protected]...
>
> Hi all,
>
> I have filled a 2d array with values - can i find out the size of the
> array WHERE Arry(1, i) = 'WB01' - for example.
>
> TIA
>
>
> --
> gti_jobert
> ------------------------------------------------------------------------
> gti_jobert's Profile:
http://www.excelforum.com/member.php...o&userid=30634
> View this thread: http://www.excelforum.com/showthread...hreadid=526695
>
You could drop it onto a spreadsheet and count those
Range("M1:N10") = arry
MsgBox Application.CountIf(Range("M1:N10"), "WB01")
--
HTH
Bob Phillips
(remove nothere from email address if mailing direct)
"gti_jobert" <[email protected]> wrote
in message news:[email protected]...
>
> yes i am,
>
> suppose I would just loop through the entire array and set up a count
> where array = 'WB01' - thought I might just be able to use ubound with
> a criteria set on it?
>
>
> --
> gti_jobert
> ------------------------------------------------------------------------
> gti_jobert's Profile:
http://www.excelforum.com/member.php...o&userid=30634
> View this thread: http://www.excelforum.com/showthread...hreadid=526695
>
UBound provides the current upper bound of the specified dimension of the
array.
I suspect there is nothing faster than looping through the array. Set it up
as a function that accepts the array and the target string as arguments and
you will have a reusable routine.
--
Regards,
Tushar Mehta
www.tushar-mehta.com
Excel, PowerPoint, and VBA add-ins, tutorials
Custom MS Office productivity solutions
In article <[email protected]>,
[email protected] says...
>
> yes i am,
>
> suppose I would just loop through the entire array and set up a count
> where array = 'WB01' - thought I might just be able to use ubound with
> a criteria set on it?
>
>
> --
> gti_jobert
> ------------------------------------------------------------------------
> gti_jobert's Profile: http://www.excelforum.com/member.php...o&userid=30634
> View this thread: http://www.excelforum.com/showthread...hreadid=526695
>
>
If the functions in the freely downloadable file at
http://home.pacbell.net/beban are available to your workbook
ArrayCountIf(Arry,"WB01") will return the number of occurrences.
Alan Beban
gti_jobert wrote:
> yes i am,
>
> suppose I would just loop through the entire array and set up a count
> where array = 'WB01' - thought I might just be able to use ubound with
> a criteria set on it?
>
>
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks