View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
drhalter drhalter is offline
external usenet poster
 
Posts: 39
Default Counting Cell Characters

Phil
You can use the Len(str) code. If your cell is A1 on sheet1 then

Sub Macro1()

Dim cellLength as Integer
cellLength = Len(Sheets("Sheet1").Range("A1"))
Msgbox(cellLength)

End sub

You can do the same thing with strings. For example, you have a string
MyString and you want to know how long it is, you can use MyStringLength =
Len(MyString).

Dave

"Phil Hageman" wrote:

Is there a macro that will count the number of characters and spaces in a
cell, or merged cell range?