Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Count quanity of values in an Array
Hi,
Dim myArray(54,100) as Sting Can I count the number of items in the second dimension of my array...? without looping through all 100 possible values and checking to see if they are not nulll... thanks Simon Shaw |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Count quanity of values in an Array
What do you mean by the second dimension of the array. Each row has 100
columns. Each column has 54 rows. What are you trying to check? -- Regards, Tom Ogilvy "Simon Shaw" <simonATsimonstoolsDOTcom wrote in message ... Hi, Dim myArray(54,100) as Sting Can I count the number of items in the second dimension of my array...? without looping through all 100 possible values and checking to see if they are not nulll... thanks Simon Shaw |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Count quanity of values in an Array
I am storing user selection lists from a ListBox in the Array:
myArray(Filter_Number, Selected_Items) where the max filters are 54 and the max selected items is 100. Usually the user will select less than 100 items say 10 items for say filter 1, how can I count the 10 items of the selected_items without looping through the array to see if items have been stored? I want to avoid: for i = 1 to 100 if myArray(1, i).value < "" then _ count = count + 1 next i "Tom Ogilvy" wrote: What do you mean by the second dimension of the array. Each row has 100 columns. Each column has 54 rows. What are you trying to check? -- Regards, Tom Ogilvy "Simon Shaw" <simonATsimonstoolsDOTcom wrote in message ... Hi, Dim myArray(54,100) as Sting Can I count the number of items in the second dimension of my array...? without looping through all 100 possible values and checking to see if they are not nulll... thanks Simon Shaw |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Count quanity of values in an Array
This counts the number of values a row at a time.
Sub ABC() Dim v(1 To 54, 1 To 100) Dim v1 as Variant For i = 1 To 10 For j = 1 To 10 v(Int(Rnd() * 54 + 1), Int(Rnd() * 100 + 1)) = i * j Next Next For i = 1 To 54 v1 = Application.Index(v, i, 0) Debug.Print i, Application.Count(v1) Next End Sub If the array elements would be alphanumeric, use countA -- Regards, Tom Ogilvy "Simon Shaw" <simonATsimonstoolsDOTcom wrote in message ... I am storing user selection lists from a ListBox in the Array: myArray(Filter_Number, Selected_Items) where the max filters are 54 and the max selected items is 100. Usually the user will select less than 100 items say 10 items for say filter 1, how can I count the 10 items of the selected_items without looping through the array to see if items have been stored? I want to avoid: for i = 1 to 100 if myArray(1, i).value < "" then _ count = count + 1 next i "Tom Ogilvy" wrote: What do you mean by the second dimension of the array. Each row has 100 columns. Each column has 54 rows. What are you trying to check? -- Regards, Tom Ogilvy "Simon Shaw" <simonATsimonstoolsDOTcom wrote in message ... Hi, Dim myArray(54,100) as Sting Can I count the number of items in the second dimension of my array...? without looping through all 100 possible values and checking to see if they are not nulll... thanks Simon Shaw |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Count values in array of data where no blanks in one column | Excel Worksheet Functions | |||
How to Reference an Array to Count Values? | Excel Discussion (Misc queries) | |||
Count occurances of equal values in two col. - array within SUMPRO | Excel Worksheet Functions | |||
Can an Array formula count unique values and report no. of times for each? | Excel Programming | |||
Count how many different text values in an array. | Excel Worksheet Functions |