Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Counting the number of elements within an array that have data

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

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 218
Default Counting the number of elements within an array that have data

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/

.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 244
Default Counting the number of elements within an array that have data

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


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Counting the number of elements within an array that have data

Why not count them when you change them?

--
Regards,
Tom Ogilvy

"ExcelMonkey " wrote in 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/



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default counting recurring part nos. in a list

i am wondering how i can get excel to count the recurring
part numbers in a list.


  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 29
Default counting recurring part nos. in a list

Have you tried using the COUNTIF function?

Roger
Shaftesbury (UK)

"sheila" wrote in message
...
i am wondering how i can get excel to count the recurring
part numbers in a list.



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Maximum number of elements in array Juarez Excel Discussion (Misc queries) 1 December 9th 08 07:49 PM
Counting the Number of Elements in an Array Confused_in_Houston[_2_] Excel Discussion (Misc queries) 3 October 1st 08 11:05 PM
What is the maximum allowed number of data elements in a data array? [email protected] Excel Discussion (Misc queries) 2 April 7th 05 06:56 PM
Counting Elements in a String carl Excel Worksheet Functions 2 December 31st 04 02:16 PM
counting column elements Daniel Pena Excel Programming 2 February 3rd 04 05:35 PM


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

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"