ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Array Ubound (https://www.excelbanter.com/excel-programming/357224-array-ubound.html)

gti_jobert[_71_]

Array Ubound
 

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


tony h[_89_]

Array Ubound
 

Are you asking how to count the number of occurances where the array
contains "WB01"

regards


--
tony h
------------------------------------------------------------------------
tony h's Profile: http://www.excelforum.com/member.php...o&userid=21074
View this thread: http://www.excelforum.com/showthread...hreadid=526695


gti_jobert[_72_]

Array Ubound
 

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


Bob Phillips[_6_]

Array Ubound
 
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" wrote
in message ...

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




Bob Phillips[_6_]

Array Ubound
 
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" wrote
in message ...

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




Tushar Mehta

Array Ubound
 
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 ,
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



Alan Beban

Array Ubound
 
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?




All times are GMT +1. The time now is 09:49 PM.

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