Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 336
Default Number of Characters in a Cell

I want to count the number of Characters in a cell. I had thought of using a
Do While loop and the Mid() Function to count, but I don't know what the last
character is?

Anybody got any ideas?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,934
Default Number of Characters in a Cell

How about using the Len function?

NumberOfCharacters = Len(Range("A1").Value)

--
Rick (MVP - Excel)


"Martin" wrote in message
...
I want to count the number of Characters in a cell. I had thought of using
a
Do While loop and the Mid() Function to count, but I don't know what the
last
character is?

Anybody got any ideas?


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 336
Default Number of Characters in a Cell

Oh dear, of course that would be the way to go, completely forgot that
function!!!

"Rick Rothstein" wrote:

How about using the Len function?

NumberOfCharacters = Len(Range("A1").Value)

--
Rick (MVP - Excel)


"Martin" wrote in message
...
I want to count the number of Characters in a cell. I had thought of using
a
Do While loop and the Mid() Function to count, but I don't know what the
last
character is?

Anybody got any ideas?



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8,520
Default Number of Characters in a Cell

Dear Martin

TRIM the value if imported from an external source and use the LEN function
as below.

LEN(Trim(Range("A" & intRow)))

If this post helps click Yes
--------------
Jacob Skaria


"Martin" wrote:

I want to count the number of Characters in a cell. I had thought of using a
Do While loop and the Mid() Function to count, but I don't know what the last
character is?

Anybody got any ideas?

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
number of characters in each cell jaywizz Excel Discussion (Misc queries) 5 June 12th 08 11:37 AM
Keep specified number of characters at end of cell? Kevin Excel Worksheet Functions 1 July 20th 07 04:40 PM
Number of characters in a cell Braders999 Excel Discussion (Misc queries) 3 July 10th 06 02:39 PM
set the number of characters in a cell CF Excel Discussion (Misc queries) 4 February 9th 06 09:37 PM
Max number of characters in a cell Dajana Excel Discussion (Misc queries) 1 September 25th 05 10:41 PM


All times are GMT +1. The time now is 03:39 AM.

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

About Us

"It's about Microsoft Excel"