ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Format Text to number (https://www.excelbanter.com/excel-discussion-misc-queries/263023-format-text-number.html)

Bruce D.

Format Text to number
 
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!
--
Bruce

Bob Phillips[_4_]

Format Text to number
 
Use COUNTA, that counts a on-empty cell.

--

HTH

Bob

"Bruce D." wrote in message
...
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!
--
Bruce




Tom Hutchins

Format Text to number
 
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

"Bruce D." wrote:

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!
--
Bruce


Bruce D.

Format Text to number
 
Yes, that works. Thanks!
--
Bruce


"Tom Hutchins" wrote:

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

"Bruce D." wrote:

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!
--
Bruce



All times are GMT +1. The time now is 06:23 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com