Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.newusers
Jan
 
Posts: n/a
Default count the number of caracters in a cell

How can I count the number of caracters including spaces in a microsoft excel
worksheet
  #2   Report Post  
Posted to microsoft.public.excel.newusers
Domenic
 
Posts: n/a
Default count the number of caracters in a cell

Try...

=LEN(A2)

Hope this helps!

In article ,
Jan wrote:

How can I count the number of caracters including spaces in a microsoft excel
worksheet

  #3   Report Post  
Posted to microsoft.public.excel.newusers
JLatham
 
Posts: n/a
Default count the number of caracters in a cell

Subject says cell, body says worksheet. I'll tackle the cell issue:

for a cell you can use the formula
= LEN(A1)
where A1 is the address of the cell with the text you need to find the
number of characters for.

"Jan" wrote:

How can I count the number of caracters including spaces in a microsoft excel
worksheet

  #4   Report Post  
Posted to microsoft.public.excel.newusers
CLR
 
Posts: n/a
Default count the number of caracters in a cell

There is a feature of the "BuiltIndocumentProperties" Property in VBA that
will supposedly return the "number of characters (with spaces)", but it does
not respond in my XL97 installation.

hth
Vaya con Dios,
Chuck, CABGx3



"Jan" wrote:

How can I count the number of caracters including spaces in a microsoft excel
worksheet

  #5   Report Post  
Posted to microsoft.public.excel.newusers
 
Posts: n/a
Default count the number of caracters in a cell


Jan wrote:
How can I count the number of caracters including spaces in a microsoft excel
worksheet


On a worksheet?

Try:

=SUM(LEN(Sheet1!1:32768))+SUM(LEN(Sheet1!32769:655 36))

This is an array formula, press Ctrl+Shift+Enter to enter it.

Put the formula on a different sheet to the one you want to count so
that you don't get a circular reference.

And it takes a long time to run - be warned.

Regards

Steve



  #6   Report Post  
Posted to microsoft.public.excel.newusers
CLR
 
Posts: n/a
Default count the number of caracters in a cell

That is SO cool Steve................
and it also works with a RangeName.........

=SUM(LEN(MyRangeName)) ......still entered as an ArrayFormula.

Vaya con Dios,
Chuck, CABGx3




" wrote:


Jan wrote:
How can I count the number of caracters including spaces in a microsoft excel
worksheet


On a worksheet?

Try:

=SUM(LEN(Sheet1!1:32768))+SUM(LEN(Sheet1!32769:655 36))

This is an array formula, press Ctrl+Shift+Enter to enter it.

Put the formula on a different sheet to the one you want to count so
that you don't get a circular reference.

And it takes a long time to run - be warned.

Regards

Steve


  #7   Report Post  
Posted to microsoft.public.excel.newusers
 
Posts: n/a
Default count the number of caracters in a cell


CLR wrote:
That is SO cool Steve................
and it also works with a RangeName.........

=SUM(LEN(MyRangeName)) ......still entered as an ArrayFormula.

Vaya con Dios,
Chuck, CABGx3


Thanks Chuck

=SUM(LEN(Sheet1!1:65536)) would have been nicer but Excel chickens out
for some reason and throws a #NUM! error.

Regards

Steve

  #8   Report Post  
Posted to microsoft.public.excel.newusers
JLatham
 
Posts: n/a
Default count the number of caracters in a cell

CLR - apparently all of the Properties listed as part of the
BuiltInDocumentProperties are not always available to all types of documents.
First, to quote from the Help topic about it:
"Container applications arent required to define values for every built-in
document property. If Microsoft Excel doesnt define a value for one of the
built-in document properties, reading the Value property for that document
property causes an error."

I experimented using the following code:

Sub GetDocumentProperties()
Dim rw As Integer
Dim p As Object
rw = 1
Worksheets("Sheet1").Activate
Range("A1").Select
On Error Resume Next
For Each p In ActiveWorkbook.BuiltinDocumentProperties
Cells(rw, 1).Value = p.Name
Cells(rw, 2).Value = p.Value
If Err < 0 Then
Cells(rw, 2) = "Error"
Err.Clear
End If
rw = rw + 1
Next
End Sub

and I found that in Excel, these properties returned errors:
Last Print Date (maybe because I've never printed this workbook)
Total Editing Time
Number of Pages
Number of words
Number of characters
Number of bytes
Number of lines
Number of paragraphs
Number of slides
Number of notes
Number of hidden Slides
Number of multimedia clips
Number of characters (with spaces)

Many of those look like they'd be associated with Word or PowerPoint.

"CLR" wrote:

There is a feature of the "BuiltIndocumentProperties" Property in VBA that
will supposedly return the "number of characters (with spaces)", but it does
not respond in my XL97 installation.

hth
Vaya con Dios,
Chuck, CABGx3



"Jan" wrote:

How can I count the number of caracters including spaces in a microsoft excel
worksheet

  #9   Report Post  
Posted to microsoft.public.excel.newusers
CLR
 
Posts: n/a
Default count the number of caracters in a cell

Hi JL..........yeah, I had the same results..........what version of XL did
you use? I heard some of the later versions handle more of the items, and
also that in the cases where XL does not automatically set some of the items,
sometimes they can be force-set by code........I dunno......it's beyond
me.......
But Steve's thingy in this thread sure is a neat way to solve the OP's
problem, huh.........

Vaya con Dios,
Chuck, CABGx3




"JLatham" wrote:

CLR - apparently all of the Properties listed as part of the
BuiltInDocumentProperties are not always available to all types of documents.
First, to quote from the Help topic about it:
"Container applications arent required to define values for every built-in
document property. If Microsoft Excel doesnt define a value for one of the
built-in document properties, reading the Value property for that document
property causes an error."

I experimented using the following code:

Sub GetDocumentProperties()
Dim rw As Integer
Dim p As Object
rw = 1
Worksheets("Sheet1").Activate
Range("A1").Select
On Error Resume Next
For Each p In ActiveWorkbook.BuiltinDocumentProperties
Cells(rw, 1).Value = p.Name
Cells(rw, 2).Value = p.Value
If Err < 0 Then
Cells(rw, 2) = "Error"
Err.Clear
End If
rw = rw + 1
Next
End Sub

and I found that in Excel, these properties returned errors:
Last Print Date (maybe because I've never printed this workbook)
Total Editing Time
Number of Pages
Number of words
Number of characters
Number of bytes
Number of lines
Number of paragraphs
Number of slides
Number of notes
Number of hidden Slides
Number of multimedia clips
Number of characters (with spaces)

Many of those look like they'd be associated with Word or PowerPoint.

"CLR" wrote:

There is a feature of the "BuiltIndocumentProperties" Property in VBA that
will supposedly return the "number of characters (with spaces)", but it does
not respond in my XL97 installation.

hth
Vaya con Dios,
Chuck, CABGx3



"Jan" wrote:

How can I count the number of caracters including spaces in a microsoft excel
worksheet

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I count the number of times a letter is used in a cell? jsrawlings Excel Discussion (Misc queries) 5 June 28th 06 02:02 AM
count each cell that have a number and take that number and count. Vick Excel Discussion (Misc queries) 3 May 19th 06 01:51 AM
Cell Count bombayterror New Users to Excel 2 January 21st 06 09:33 PM
Instead of a negative number, I'd like to show zero... Dr. Darrell Excel Worksheet Functions 6 December 7th 05 08:21 PM
how to count the number of decimal places in a cell? Warren Smith Excel Worksheet Functions 7 August 28th 05 01:52 PM


All times are GMT +1. The time now is 09:22 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"