ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Finding values within an array (https://www.excelbanter.com/excel-programming/357239-finding-values-within-array.html)

MattShoreson[_74_]

Finding values within an array
 

Is there a neater/faster way than having to use worksheet functions and
iterating through an array to find values.

my example - I have an array containing the following:
AAAA ZZ 0001
BBBB ZZ 0001
AAAA XX 0001
BBBB ZZ 0001
AAAA XX 0001

I'm aiming to search for 'AAAA' and 'XX' which would return a subtotal
of 2.
If this needs more explain - give a shout.
Cheers,
Matt.


--
MattShoreson
------------------------------------------------------------------------
MattShoreson's Profile: http://www.excelforum.com/member.php...fo&userid=3472
View this thread: http://www.excelforum.com/showthread...hreadid=526723


Tom Ogilvy

Finding values within an array
 
Beyond worksheet functions, there are no VBA functions that would do what you
want. That said, looping through an array is very fast. the only function I
can think of that comes close to working with an array is the Filter
function, but it only works on a one dimensional array of strings.
--
Regards,
Tom Ogilvy


"MattShoreson" wrote:


Is there a neater/faster way than having to use worksheet functions and
iterating through an array to find values.

my example - I have an array containing the following:
AAAA ZZ 0001
BBBB ZZ 0001
AAAA XX 0001
BBBB ZZ 0001
AAAA XX 0001

I'm aiming to search for 'AAAA' and 'XX' which would return a subtotal
of 2.
If this needs more explain - give a shout.
Cheers,
Matt.


--
MattShoreson
------------------------------------------------------------------------
MattShoreson's Profile: http://www.excelforum.com/member.php...fo&userid=3472
View this thread: http://www.excelforum.com/showthread...hreadid=526723




All times are GMT +1. The time now is 10:16 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com