PC Review


Reply
Thread Tools Rate Thread

Counting the number of elements within an array that have data

 
 
ExcelMonkey
Guest
Posts: n/a
 
      17th May 2004
I have a 1D VBA array filled with integers. I have gone through th
array and deleted various element (i.e. array(3) = "",array(7) = "
etc).

I now want to count the number of elements within the revised arra
which contain integers only (or no data at all - whatever is easier).

How do I do this?

Thank

--
Message posted from http://www.ExcelForum.com

 
Reply With Quote
 
 
 
 
Greg Wilson
Guest
Posts: n/a
 
      17th May 2004
Try:

MsgBox Application.Count(Array)

Regards,
Greg

>-----Original Message-----
>I have a 1D VBA array filled with integers. I have gone

through the
>array and deleted various element (i.e. array(3)

= "",array(7) = ""
>etc).
>
>I now want to count the number of elements within the

revised array
>which contain integers only (or no data at all - whatever

is easier).
>
>How do I do this?
>
>Thanks
>
>
>---
>Message posted from http://www.ExcelForum.com/
>
>.
>

 
Reply With Quote
 
 
 
 
=?Utf-8?B?Y2hyaXM=?=
Guest
Posts: n/a
 
      17th May 2004
If you use the code i gave you to transfer the Elements to a New array all you have to do is use UBound(Myarray) to get the upper number and then based on your Option base: 0 = Num -1 OR 1 = Nu

But if you just want to count then here

Dim i as single, j as singl
For i = LBound(YourArray) To UBound(YourArray
if Not MyArray(i) = "" then j =j+
Next
Debug.print "Total number of elements with a value = " &
Debug.Print "Total number of elements with No Value = " UBound(YourArray) -

----- ExcelMonkey > wrote: ----

I have a 1D VBA array filled with integers. I have gone through th
array and deleted various element (i.e. array(3) = "",array(7) = "
etc)

I now want to count the number of elements within the revised arra
which contain integers only (or no data at all - whatever is easier)

How do I do this

Thank


--
Message posted from http://www.ExcelForum.com


 
Reply With Quote
 
Tom Ogilvy
Guest
Posts: n/a
 
      17th May 2004
Why not count them when you change them?

--
Regards,
Tom Ogilvy

"ExcelMonkey >" <<(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> I have a 1D VBA array filled with integers. I have gone through the
> array and deleted various element (i.e. array(3) = "",array(7) = ""
> etc).
>
> I now want to count the number of elements within the revised array
> which contain integers only (or no data at all - whatever is easier).
>
> How do I do this?
>
> Thanks
>
>
> ---
> Message posted from http://www.ExcelForum.com/
>



 
Reply With Quote
 
sheila
Guest
Posts: n/a
 
      26th May 2004
i am wondering how i can get excel to count the recurring
part numbers in a list.
 
Reply With Quote
 
Roger Whitehead
Guest
Posts: n/a
 
      26th May 2004
Have you tried using the COUNTIF function?

Roger
Shaftesbury (UK)

"sheila" <(E-Mail Removed)> wrote in message
news:1a2901c4433a$5f6fc0a0$(E-Mail Removed)...
> i am wondering how i can get excel to count the recurring
> part numbers in a list.



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Counting the Number of Elements in an Array Confused_in_Houston Microsoft Excel Misc 3 1st Oct 2008 11:05 PM
Counting elements of array and range type data =?Utf-8?B?VG9tTGVnYWRv?= Microsoft Excel Programming 13 16th Sep 2007 10:59 PM
What is the maximum allowed number of data elements in a data array? slingsh0t@hotmail.com Microsoft Excel Misc 2 7th Apr 2005 06:56 PM
elements within elements in xsd (I think) jake Microsoft C# .NET 2 13th Feb 2005 09:26 PM
Comparing ARRAY elements with RANGE data and created a 2nd array JimP Microsoft Excel Worksheet Functions 2 10th Mar 2004 08:29 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 11:15 PM.