Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to Count Character In a Cell 1

Status
Not open for further replies.

JoaoLima

IS-IT--Management
Feb 20, 2002
1
BR
Hi All,
I Would like to know how to count the number of character in a selected cell.
Thanks in advance,

João Lima
 
I assume you mean in Excel?

If so, this is not really a VBA way to do it but the easiest way is to use the command =LEN(A1). If you put this in any cell except A1 it will return the length of the contents of cell A1.

Is that what you meant?
 
If you need to do it in VBA, you can use one of the following, with A1 as the example :

= Len([A1]) , or

= Len(Range("A1"))

AC
 
or how about: myCount = Activecell.Characters.Count?

Asjeff
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top