Showing cell text length while typing

jmacleary

Well-known Member
Joined
Oct 5, 2015
Messages
1,060
Office Version
  1. 365
  2. 2007
Platform
  1. Windows
Hello folks. I want to be able to see how many characters I am typing into a cell as I type. I know there are many ways to see the length after the data is entered, but I need to see the count 'in-flight' if possible.
 

Excel Facts

Which lookup functions find a value equal or greater than the lookup value?
MATCH uses -1 to find larger value (lookup table must be sorted ZA). XLOOKUP uses 1 to find values greater and does not need to be sorted.
Hi,

To my knowledge, while in Edit mode ... you cannot have a counter displaying the number of characters being typed ...:(
 
Upvote 0
Hi Dave

I found that on google but my companies proxy restrictions dont allow me to view it.
 
Upvote 0
It's basically suggesting using a textbox, rather than typing into a cell.
You can then use a change event to count the number of characters & display it in a cell
 
Upvote 0
I think using the PeekMessage API and watching for the keystrokes might work even while in edit mode.

Where do you want to see the resulting text length ?
 
Last edited:
Upvote 0
If Jaafar steps in ... be prepared for an extra-ordinary solution ...!!! :)

@ Jaafar ... could you get the keystroke counter to continuously update the cell's comment ... ??? :wink:
 
Upvote 0
I think using the PeekMessage API and watching for the keystrokes might work even while in edit mode.

Where do you want to see the resulting text length ?

I would like to see it in the adjacent cell (so if typing into C7, I would want to see D7 continuously update.)
 
Last edited:
Upvote 0
I would like to see it in the adjacent cell (so if typing into C7, I would want to see D7 continuously update.)

Sorry to disappoint you but after giving this a try it turned out to be more difficult than I initially thought.

Certainly, one can call PeekMessage inside a loop and increment the counter each time an Alphanumeric key is pressed but if the user decides to select a chunk of text inside the cell that is being edited and deletes the selected text then there is no way to maintain the coreect count.

I was also hoping to work around this by reading the whole text string using the UIAutomation libarary but that didn't work either.

You would just have to use an ActiveX Textbox for the time being as previously kindly suggested by daverunt and Fluff.

Regards.
 
Upvote 0
OK Jaafar - thanks for your effort - I was pretty sure it would prove very difficult/impossible.
 
Upvote 0

Forum statistics

Threads
1,214,784
Messages
6,121,540
Members
449,038
Latest member
Guest1337

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top