On the Excel Ribbon, Click on the Data Tab. Select Data Validation. Select Data Validation again.

In the allow box, select text length
In the data box, select less than
In the maximum box, select 9

Click ok.