Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() Hai buddies, i am having a array declaration like this Code ------------------- dim a(10) as Integer ------------------- and it has some values say 1,4,2,5 ( only 4) .Now i want to find the total no.of values in the array (i.e 4). i use Ubound but it is giving me the total capacityof the array which i am n' interested. what is the function i have to use to find that. thanks & regards, mahes -- itsmahesh ----------------------------------------------------------------------- itsmaheshp's Profile: http://www.excelforum.com/member.php...fo&userid=1585 View this thread: http://www.excelforum.com/showthread.php?threadid=27655 |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() You cant do this with an array that's declared as an integer, (cause all the elements are 0) but you could it you'd declare it as a variant.. (elements are initialized as empty) Sub test() Dim a(10) As Variant Dim l As Long a(3) = 4 'countA counts strings & numbers 'count counts numbers only l = Application.CountA(a) Stop End Sub maybe you'd be better served with using a collection object? -- keepITcool | www.XLsupport.com | keepITcool chello nl | amsterdam itsmaheshp wrote : Hai buddies, i am having a array declaration like this Code: -------------------- dim a(10) as Integer -------------------- and it has some values say 1,4,2,5 ( only 4) .Now i want to find the total no.of values in the array (i.e 4). i used Ubound but it is giving me the total capacityof the array which i am n't interested. what is the function i have to use to find that. thanks & regards, mahesh |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Modify array function length | Excel Worksheet Functions | |||
using VB to read in a column of values of varying length into an array | Excel Worksheet Functions | |||
how do I do a variable length array based on the value in a cell | Excel Discussion (Misc queries) | |||
Array Length. | Excel Programming | |||
Array Length. | Excel Programming |