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.
 

Excel Facts

How to fill five years of quarters?
Type 1Q-2023 in a cell. Grab the fill handle and drag down or right. After 4Q-2023, Excel will jump to 1Q-2024. Dash can be any character.
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)
 
Upvote 0
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?
 
Upvote 0
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
 
Upvote 0
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.
 
Upvote 0
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).
 
Upvote 0
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. :)
 
Upvote 0
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.
 
Upvote 0
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 :)
 
Upvote 0
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.
 
Upvote 0

Forum statistics

Threads
1,213,507
Messages
6,114,029
Members
448,543
Latest member
MartinLarkin

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