none
Change font color of Pivot table row label via VBA RRS feed

  • Question

  • Hi all,

    Is it possible, using VBA, to change the font color of row labels? 

    Casey

    Wednesday, August 12, 2015 7:36 PM

Answers

  • Hi Casey,

    >> Is it possible, using VBA, to change the font color of row labels? 

    Yes, you could try a simple code as below:

    Sub testPivot()
    ActiveSheet.UsedRange.Select
    ActiveCell.PivotTable.RowRange(1).Select 'select the row Labels (first row) of Row range
        With Selection.Font
            .Color = -16776961
            .TintAndShade = 0
        End With
    End Sub

    For more information about PivotTable.RowRange, you could refer the link below:

    # PivotTable.RowRange
    https://msdn.microsoft.com/EN-US/library/office/ff196897.aspx

    Best Regards,

    Edward


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.


    • Proposed as answer by André Santo Thursday, August 13, 2015 1:23 PM
    • Marked as answer by Casey_M Thursday, August 13, 2015 4:28 PM
    Thursday, August 13, 2015 11:20 AM