Solved

Counting No. of values in Arrays

Posted on 1998-08-27
1
119 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
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

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

747 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now