Changing colour of text when text reaches certain length

hammo

New Member
Joined
May 8, 2002
Messages
2
Can anyone tell me how I can change the colour of the text in a cell once the text in that cell reaches a certain length, say 80 characters long
 

Excel Facts

How can you turn a range sideways?
Copy the range. Select a blank cell. Right-click, Paste Special, then choose Transpose.
On 2002-05-09 18:38, hammo wrote:
Can anyone tell me how I can change the colour of the text in a cell once the text in that cell reaches a certain length, say 80 characters long

How about going with Conditional Formatting with Formula is
=len(a1)>=80 ... FONT Color --> 'red'

This will format the color of the text red if the text you have entered is more than 80 characters. It is not going to capture the length of the string as the text is being typed -- for that you may have to adopt DATA|VALIDATION.

Hope This Helps!
 
Upvote 0
Use conditional formatting & the LEN function:

select the cell(s) you want to format. Go to format - conditional formatting. Change 'cell value is' to 'formula is'. Enter the appropriate formula, for example:
=len(A1) > 80
Click the format button & select the format you want to apply....

Paddy
 
Upvote 0
Thanks Yogi & Paddy,

Is it possible to do this real time (ie the moment the string they are typeing exceeds 80 chars rather than when they exit the cell?
 
Upvote 0
On 2002-05-09 20:24, hammo wrote:
Thanks Yogi & Paddy,

Is it possible to do this real time (ie the moment the string they are typeing exceeds 80 chars rather than when they exit the cell?

In my opinion, practically speaking you can combine it with DATA|VALIDATION to permit a string of maximum number of characters -- and after the dtring has been entered, you would know whther it is more than 80 characters.

For real time capture of the length of the string, you will have to use VBA.

Regards!
 
Upvote 0

Forum statistics

Threads
1,214,591
Messages
6,120,428
Members
448,961
Latest member
nzskater

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