Solved

Counting No. of values in Arrays

Posted on 1998-08-27
1
124 Views
Last Modified: 2010-04-30
I define an array of 10 items, say a[10].
I give for 3 arrays say a[0] = 38, a[3] = 980, a[7] = 98
The remaining arrays 7 of them are without values.
What I want is to get the count of number of arrays (with values) and in this case should give the count as 3.

Is there any function /user defined logic to do this one.
Anticipating a postive response from your end for this case.
Thankyou in advance for your help.
0
Comment
Question by:Favourites
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 6

Accepted Solution

by:
clifABB earned 10 total points
ID: 1431354
Nope, sorry.

The best you can do is:
nCount = 0
For nCnt1 = LBound(a) to UBound(a)
  If a(nCnt1) > 0 Then
    nCount = nCount + 1
  End If
Next nCnt1
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
how to know if my Checkbox is True in VB6.0? 9 68
VB script to continue despite error 2 77
Modify Text File with Excel Macro 13 46
2 Global Vars, 1 List Box 4 30
Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

737 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question