View Single Post
  #8   Report Post  
Posted to microsoft.public.excel.programming
Jack_Feeman Jack_Feeman is offline
external usenet poster
 
Posts: 47
Default Real-time character counter

I have tried all the great suggestions and for reasons peculiar to this form
we am developing, this is what we came up with and what we still need to
accomplish.

What we have done:
OUr form includes four comment cells: A1, D1, G1, J1. Above each comment
cell is a title cell (which identifies the comment cell) and a results cell
(which displays the number of characters entered in the comment cell
(=1024-(refcell)). 1024 is the limit we know will print out (without the Alt
Enter workaround). This works great but is not realtime. It only updates when
the user exits the cell or deletes the cell's contents.

What we still need to do:
Can we add an auto_execute macro that scans for focus? When the current
focus is on one of those four cells, it shows the character count via a
continuous loop until the cell loses focus (user exits the cell).

If not, can I use a UserForm to do the same? When focus is on one of those
four cells bring up the UserForm and start counting the number of characters
in the cell. And when the cell looses focus, the UserForm is canceled.

We are almost there and we really do appreciate all of your help. Thanks
Jack

"Jack_Feeman" wrote:

Thanks Dave,
I had heard of the Alt-Enter method which would require users to remember to
enter it every so often which is a lot harder than it looks. Besides then the
form pagination would be way off if the user got long winded in one of the
comment cells. I will keep that in mind though.

I tried using a text box from the toolbox in a cell and the Userform is
another way to approach it. I will try them both. Thanks again
Jack

"Dave Peterson" wrote:

Macros won't run while the user is editing the cell.

You could create a userform with a textbox on it and count the current number of
characters as they type.

And actually excel can print and show more than those 1024 characters in a
cell. If you add alt-enters (to force a new line within the cell) every 80-100
characters, you can see and print lots more.

Jack_Feeman wrote:

Excel 2003
I am trying to display a character counter in real time. Scenario:
An Excel form has a comment cell where the user types a comment.
(We all know that Excel can display 1024 characters in a cell and 32,767 in
the formula bar. When you print, Excel can only print a portion of those and
help doesn't give the exact mount).
I need to print the entire contents of a cell up to the limitaions above.
The Excel Printing group suggested that I use the =LEN(cellref) to count the
characters in the cell to give the user a warning of how many characters they
have entered. Assuming that Excel can print what it displays in the cell
(1024 characters), I amended that fomrula to =1024-LEN(cellref) which works
good but only after you leave the comment cell.
Is there a way to make the results of this counter cell real-time? (To give
a running result while the user is still in the comment cell.)
If it is not possible, I would like to add a character counter to the cell
or adjacent cell so users know how many characters they have left before the
print copy won't show them. Anyone know where or how I can get/vba a counter?

Thanks
Jack


--

Dave Peterson