Data Validation Query - How do I stop data being input in a cell once maximum characters are reached

  • Thread starter Thread starter Colin
  • Start date Start date
C

Colin

Hi

I am able, using data validation, to restrict input into a cell to 30
characters and display warnings and error messages. However, it
allows the person entering to enter, for example, 50 characters and
only when enter is pressed will it then state this is not allowed.

Please advise how I may simply stop characters being input into a
particular cell once the maximum of 30 characters is reached. ie the
pc will bleep and the inputter will have to go back and edit the cell
description within the maximum set.

Many thanks for any advice on this.

Colin
 
You can't do it in a cell - XL's Edit Mode suspends macros (though
there may be a cute API method).

Instead, perhaps you can use a Userform/Textbox for data entry and
use the Textbox's change event to limitj entry to 30 characters,
then write the text to the cell.
 
Back
Top