Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
But not by doing an for i = lbound(x()) to ubound(x()) and counter?
Thanks Peter |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
On Aug 22, 12:01 am, Peter wrote:
But not by doing an for i = lbound(x()) to ubound(x()) and counter? Thanks Peter Dim lngElements as Long lngElements = WorksheetFunction.CountA(x) will tell you the number of elements in the x array that have been assigned a value. Ken Johnson |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Here is one way, assuming option base zero.
Sub arry() Dim myArry As Variant myArry = Array("This", "That", "Other") MsgBox UBound(myArry) + 1 End Sub "Peter" wrote: But not by doing an for i = lbound(x()) to ubound(x()) and counter? Thanks Peter |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
If the array (say arr1) is a one-dimensional array or a single column:
no. of elements = Ubound(arr1) - Lbound(arr1) + 1 If it's a 2 dimensional array: no. of elements = (Ubound(arr1) - Lbound(arr1) + 1) * _ (Ubound(arr1,2) - Lbound(arr1,2) + 1 Alan Beban Peter wrote: But not by doing an for i = lbound(x()) to ubound(x()) and counter? Thanks Peter |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
array elements count | Excel Programming | |||
Reference Elements w/in an Array | Excel Discussion (Misc queries) | |||
Shifting Array Elements | Excel Programming | |||
Refer to Elements in an array | Excel Programming | |||
Count elements in array | Excel Programming |