Conditional Formatting by character count

rjwell

New Member
Joined
Mar 30, 2009
Messages
5
If this topic is covered by a previous thread ... please forgive and link me to the thread.

I've been searching for code that can do the following ...

After cell update
If character count is 5 or less set font size equal to 12
If character count greater than 5 set font size equal to 10

I'm not into coding and any of my VBA attempts results in no change.

Thanks for the help.
 
OK, what is the result of the formula
Code:
=LEN(A1)
Replace A1 with the cell reference for the Welding entry.
Then do the same for the Hospitality entry.
 
Upvote 0

Excel Facts

Highlight Duplicates
Home, Conditional Formatting, Highlight Cells, Duplicate records, OK to add pink formatting to any duplicates in selected range.
Gerald,

I'm not sure what you mean exactly. You want me to create a separate conditional formatting for each of my almost 10,000 course names??? That's not going to work. I was hoping I could create 1 conditional format for an entire column (in this case D) that would count the characters in each cell in that column (including spaces, hyphens etc) and if the total number of characters is more than 60 it would turn the background red. That way I can go into each of those cells, manually adjust the name of the course, and when the red background goes away I know it's now 60 characters or less.

The =LEN(D2)>60 formula isn't working. I'm not sure why. It doesn't seem to make logical sense that it would highlight a cell with only 23 characters and then in the row right beneath that it would highlight a cell with 63, and then in the row right beneath that wouldn't highlight a cell that also has 63 characters. Would it have anything to do with the fact that we're using a specific cell reference (D2)??
 
Upvote 0
I think he is saying to just put the formula in the worksheet to see what results you yield?
 
Upvote 0
I created a temporary column beside my column of course names and put the formula =LEN(D7459) for the C Welding Fabrication and it gives me 21. I also did it for D Hospitality and Tourism Management- Intern Travel and Tourism (i used =LEN(D7460)) and it gave me 63.

Is that what you were asking?
 
Upvote 0
Yes I believe so, if that were the case and you are using:

=len(D7459)>60 this should not highlight
=len(d7460)>60 this should highlight

I'm not sure why the conditional formatting is not work for you?
 
Upvote 0
schielrn is interpreting my post exactly right.

What I was getting at was, is the length of your strings actually less than 60 or not, and using the LEN function in a helper column tells you what the length actually is.
The reason I asked this is because sometimes the true length of a text string can be very different from what it appears to be.

But I think we've established that the length of the strings is in line with what you would expect, so that's good.

The "Welding Fabrication" text string is in cell D7459 - is that right ?
What is the exact formula you have in the conditional formating dialog box for that cell ?

The "Hospitality" text string is in cell D7460.
What is the exact formula you have in the CF DB for that cell ?

If the CF for ALL your cells refers to D2, that could be your problem.

Please be assured, I'm not suggesting you "create a separate conditional formating for each of your 10,000 course names".
What I think we need to do is find out why CF appears not to be working correctly, correct whatever the problem is, and then copy that formating for each of your 10,000 course names.
 
Upvote 0

Forum statistics

Threads
1,223,234
Messages
6,170,891
Members
452,366
Latest member
TePunaBloke

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