Count items in a column

  • Thread starter Thread starter Chad
  • Start date Start date
C

Chad

Hi All,

I am sure this is the easiest thing in the world, but I cannot find the
command.

I have about 20 columns, with random numbers of entries in each column. I
need a command to count the items in each column and store each count in a
seperate variable.

I have the loop setup and the variables, I just need the command to count
the items.

Thanks in advance,
Chad
 
The following will store the count of the non blank cells for the first 20
columns of the active worksheet:

Dim myArray(1 To 20) As Integer
Dim I As Integer
For I = 1 To 20
myArray(I) = Application.CountA(Columns(I))
Next

Bob Flanagan
Macro Systems
http://www.add-ins.com
Productivity add-ins and downloadable books on VB macros for Excel
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top