• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

color scale by each row in Pivot Table using VBA

Kali Runk

New Member
Good Morning,

This is my first post and I am new to coding.
Code:
I would like to use conditional formatting, specifically color scaling to evaluate EACH row individually. I know in order to do that I would need to do each row individually but the pivot table is too large to do that and it changes in length and width often.

I wrote a small code but its not working correctly. I need it to automatically update when refreshed.

I would appreciate any help. I am attaching my file that just contains a copy of my pivot table in the exact rows and cells and my current code is below. The file size is too large to upload.
Since I am VERY new to coding, please be very specific with suggestions.

With PT.PricePerItem

  .FormatConditions.Delete
  
  .FormatConditions.Add Type:=xlExpression, Formula1:="=rc=max(rc6:rc14)"
  .FormatConditions(1).Interior.Color = RGB(255, 77, 51)
  
  .FormatConditions.Add Type:=xlExpression, Formula1:="=rc=min(rc6:rc14)"
  .FormatConditions(2).Interior.Color = RGB(61, 245, 0)
  
  .Interior.Color = RGB(255, 255, 122)


End With

Thanks,
Kali
 

Attachments

  • Conditional Formating Color Scale.xlsx
    14.1 KB · Views: 3
Back
Top