computing
  • 14

Conditional Formatting a Text Box In a Chart

  • 14

I have a text box placed in a chart that links to another sheet/cell for its content. The value is a percentage. I can format the source text using conditional format, but the formatting doesn’t carry forward into the text box. Is there a way to script/macro or use if/then for the value of a text box to change the font color? The text box is linked simply with “=Data!$J$7” ? Any help would be greatly appreciated!

Share

1 Answer

  1. Hi,

    Not sure that I properly understand the problem.

    I did come up with this routine that removes the visible background on all Text Boxes in Charts.

    Sub TBClear()
    Dim objChartObj As ChartObject
    Dim objTxtBx As Shape
    
    For Each objChartObj In Worksheets("Sheet2").ChartObjects()
        For Each objTxtBx In objChartObj.Chart.Shapes()
            objTxtBx.Fill.Visible = msoFalse
        Next objTxtBx
    Next objChartObj
    End Sub

    Perhaps you can modify this to suit.

    Regards

    • 0