Count Characters in a Single Cell

S

snsd

I have used the Validation function to limit the number of characters i
a single cell to no more that 14,256. (I am copying & pasting the cel
contents to a mainframe that has a limit of 14,256 characters.)

Ideally, what I would like to do is create an object(?) that will tel
me how many characters that are left. eg. If I've entered 14,00
characters, I would like the object to say that there are 256 left.

It would be great if the "characters left" meter would countdown a
text is entered but I assume that Excel cannot do the count until yo
hit the Enter key.

Any help in either helping me do a simple character count or
"characters left" count would be greatly appreciated.

Thanks,

Dav
 
J

JE McGimpsey

one way (with report in the status bar):

Assume the cell is A1 (change to suit):

Private Sub Worksheet_Change(ByVal Target As Excel.Range)
Const nMAX = 14256
With Target
If .Address(False, False) = "A1" Then
Application.StatusBar = "Cell " & _
.Address(False, False) & ": " & Len(.Value) & _
" characters, " & nMAX - Len(.Value) & " left."
Else
Application.StatusBar = False
End If
End With
End Sub
 
C

crispbd

A simple formula should take care of your question



Assuming that the cell Row 1, Column 5 has the Validated string, plac

the following formula in Row 1, Column 6 (fill the formula down th
sheet)

=14256-Len(F1) & " characters remaining
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top