Format Text to number

B

Bruce D.

I am using excel 2007 and I am creating a macro that will count the number of
account numbers in a column. The problem is that the account numbers are
stored as text not number. This prevents the count() function from working.
Is there a way to get this accomplished.

Thanks!
 
T

Tom Hutchins

Try COUNTA instead of COUNT. COUNTA counts non-blank cells, not just numbers.
To use COUNTA in a macro you will have to refer to it like this:
Application.WorksheetFunction.CountA(etc.)
since it is a worksheet function, not a VBA function.

Hope this helps,

Hutch
 
B

Bruce D.

Yes, that works. Thanks!
--
Bruce


Tom Hutchins said:
Try COUNTA instead of COUNT. COUNTA counts non-blank cells, not just numbers.
To use COUNTA in a macro you will have to refer to it like this:
Application.WorksheetFunction.CountA(etc.)
since it is a worksheet function, not a VBA function.

Hope this helps,

Hutch
 

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

Top