How to use conditional formatting and character count for a cell to color the characters red after the limit has been reached, but only the ones OVER the limit

Anonymous
2023-11-23T17:51:36+00:00

How do I use conditional formatting and character count for a cell to color the characters red after the limit has been reached, but only the ones OVER the limit.

That's the question.

Basically I want the letters AFTER the limit light up in red, not the whole cell.

I need this:

if LEN=11 color the characters after 10 red

Would look like this:

I have a problem

Is that possible in Excel by any means or am I just not finding this option?

Colouring cells with LEn is no problem at all, but then it looks like this:
I have a problem

And this is ... a problem. ;)

This would be super useful for writers like me who have a lot of text limits and need to see visually how much of the text might get truncated.

Hope someone can help, but yeah. I think this is extra macros, right? If so, don't bother. I don't know how to use those. ^^

Microsoft 365 and Office | Excel | For business | Other

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Anonymous
    2023-11-23T18:19:24+00:00

    Conditional formatting can be apply to entire cell. There is no such function to apply to characters which is after 12 lengths.

    If you don't want to use macro, you may try formula to divide the cell into 2 parts.

    =LEFT(A2,10)

    Image

    .

    =MID(A2,11,1000)

    Image

    .

    Here is the step for macro, you may have a try.

    Alt+F11 to open VB Editor, Paste code in it. Then press F5 to run the code.

    ===================

    Sub RedCharacters()

    Dim cell As Range 
    
    For Each cell In Range("A:A") 
    
        If Len(cell.Value) > 11 Then 
    
            For i = 11 To Len(cell.Value) 
    
                If Mid(cell.Value, i, 1) <> " " Then 
    
                    cell.Characters(i, 1).Font.Color = vbRed 
    
                End If 
    
            Next i 
    
        End If 
    
    Next cell 
    

    End Sub

    ===================

    Image

    0 comments No comments
  2. Anonymous
    2023-11-24T03:23:26+00:00

    if.with sql

    select *,replace(f01,substr(f01,11), highfont(substr(f01,11))) from red_after_limit ;

    0 comments No comments