Conditional Formatting Non Blank Cells n Pivot Table

  • Hi, I am trying to figure the VB code to highlight or Fill all Non-Blank Cells within a pivot table range (range is different each time I run the macro but the pivot table name will always be "PivotTable1" and the worksheet its on will always be named "Who's On 1st".


    So, the columns that this will not int he pivot table that this will not need to apply to is the first column, the first row, and the last row (Column Label, Row Label, and Grand Total)


    Color to highlight/Fill = 204


    Anyone know how to do this??

  • Re: Conditional Formatting Non Blank Cells n Pivot Table


    So I Used this... Just need to get it to not apply to the first column , last row, or first row. Can anyone tell me how to make the fill of these ranges white?


    Code
    Sub Fill()    With ActiveSheet.PivotTables("PivotTable2")
            For Each rCell In Range("B3").CurrentRegion
                If rCell.Value <> "" Then
                    rCell.Interior.Color = vbRed
                Else: rCell.Interior.Color = vbWhite
                End If
            Next rCell
        End With
    CurrentRegion.Select
    End S
  • Re: Conditional Formatting Non Blank Cells n Pivot Table


    Well - the spreadsheet gets refreshed with data, then the macro runs which adds these sheets..

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!