Author Topic: Conditional formatting text color depending on text itself  (Read 921 times)

0 Members and 1 Guest are viewing this topic.

michaelj1103

  • Newbie
  • *
  • Posts: 7
I was wondering if it was possible for format the character color based off of the actual text itself? So for example, if the text contained the characters 123, then it would change all the characters red. So the text ABC123 would look like that. And if 123 was not in the text then it would just be Black. Thanks.

Surrogate

  • Hero Member
  • *****
  • Posts: 1730
    • ShapeSheet™ Knowledge Base
Re: Conditional formatting text color depending on text itself
« Reply #1 on: May 19, 2022, 04:33:08 PM »
I was wondering if it was possible for format the character color based off of the actual text itself? So for example, if the text contained the characters 123, then it would change all the characters red. So the text ABC123 would look like that. And if 123 was not in the text then it would just be Black.
If I understand the condition correctly: if the length of the text sequence is more than 3 characters and the last three characters are 123, then the font is red (value 2). In all other cases the font is black (value 0).
You must activate Developer mode, and open ShapeSheet environment window (hope this video can helps, just see first minute).
In ShapeSheet window scroll and find Character section.

Write formula IF(AND(STRSAME(RIGHT(SHAPETEXT(TheText),3),"123"),LEN(SHAPETEXT(TheText))>3),2,0) in cell Color in Character section.

« Last Edit: November 21, 2022, 09:17:34 AM by Surrogate »

michaelj1103

  • Newbie
  • *
  • Posts: 7
Re: Conditional formatting text color depending on text itself
« Reply #2 on: May 20, 2022, 01:17:13 PM »
That works perfect. Thank you for your help!