Character Count Limit

Abrunetti

New Member
Joined
Jun 13, 2015
Messages
6
Hi everyone, first post... Need help.

I need to set a specific character count in an excel cell. I only have 5 lines, first line is a count of 50 characters (including spaces) and the rest are a count of 75.

If it can't be done, Word is an option. Really need to get this done asap, any help is appreciated. I'm not as well versed in excel so macros which I saw as a solution are not in my realm.
 

Some videos you may like

Excel Facts

Quick Sum
Select a range of cells. The total appears in bottom right of Excel screen. Right-click total to add Max, Min, Count, Average.

gaz_chops

Well-known Member
Joined
Apr 29, 2003
Messages
6,468
Platform
  1. MacOS
Welcome to the forum.

To limit a cell to a number of characters try data validation.

Select Data > Validation
In the box "Allow" select "Text Length"
In "Data" box select "less than"
Enter Max as 50 (or 75)
 

Rick Rothstein

MrExcel MVP
Joined
Apr 18, 2011
Messages
36,686
Office Version
  1. 2010
Platform
  1. Windows
I need to set a specific character count in an excel cell. I only have 5 lines, first line is a count of 50 characters (including spaces) and the rest are a count of 75.
Your question is not clear to me. Are you asking for a function that will return the count of characters in the cell? Or are you asking for code that will warn you if the count on a line is incorrect? Or are you asking for code that will let the use type characters into a cell and, when done, automatically redistribute the characters according to your 50/75/75/etc. pattern? Or are you asking for something altogether different than any of those ideas?
 

Abrunetti

New Member
Joined
Jun 13, 2015
Messages
6
Thank you, I understand that and did that as well but the error comes up after they type, I'm looking for a message prior to the user finishing typing
 

Rick Rothstein

MrExcel MVP
Joined
Apr 18, 2011
Messages
36,686
Office Version
  1. 2010
Platform
  1. Windows

ADVERTISEMENT

Thank you, I understand that and did that as well but the error comes up after they type, I'm looking for a message prior to the user finishing typing
Your message does not look like a response to the questions I asked you. However, that last part (highlighted above) cannot be accomplished as no VB code can run when a cell is in Edit Mode (that is the mode when text is being typed into a cell)... the entry must be completed before the text in the cell can be parsed in any way.
 

Abrunetti

New Member
Joined
Jun 13, 2015
Messages
6
Thank you for the reply. I'm actually looking for the cell to either not allow characters over 50/75, or once the character goes over 50, to start in the new cell (the 75 character limit).
 

shg

MrExcel MVP
Joined
May 7, 2008
Messages
21,779
Office Version
  1. 2010
Platform
  1. Windows

ADVERTISEMENT

As Rick said, no VBA code is going to run while Excel is in Edit mode; validation occurs after entry.

Rick would be happy to provide code that distributes the results after entry. :)
 

Abrunetti

New Member
Joined
Jun 13, 2015
Messages
6
Ok, thanks for the responses. So there is no way to have a cell hard capped with a character count of 50 or 75 characters, correct?

Now, I can have the error populate, but the user could type 100 characters with no insight into what the user has left in terms of cell space.
 

shg

MrExcel MVP
Joined
May 7, 2008
Messages
21,779
Office Version
  1. 2010
Platform
  1. Windows
So there is no way to have a cell hard capped with a character count of 50 or 75 characters, correct?
Not during entry, unless you used some very low-level code Windows code, which I'm not capable of writing.
the user could type 100 characters with no insight into what the user has left in terms of cell space.
You could use a textbox on a userform -- Rick would be happy to provide that code as well, probably :)
 

Abrunetti

New Member
Joined
Jun 13, 2015
Messages
6
That would work. Anything will help. I just want to have a template that I can use that limits the characters or makes them go to the next line. Thanks so much.
 

Watch MrExcel Video

Forum statistics

Threads
1,122,670
Messages
5,597,482
Members
414,144
Latest member
UDFNewbie

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
Top