What I want it to do is intersect rows "Emp. Name" & "Avg Salary". I can then apply Font.Color filters to specific values down the line, but for now I can't figure out how to select the correct intersects.This is what the pivot looks like.
<tbody>
</tbody>Here is what I have so far but its not working. Essentially, it is applying the Font.Color changes to the entire "Avg Salary" Column instead of only to the "Emp Names" in "Avg Salary".
This is what I want the code to do.
<tbody>
</tbody>
Any help being able to find the correct intersect would be much appreciated.
Values | ||||
Row Labels | Avg. Salary | Data #1 | Data #2 | Data #3 |
Manager #1 | 75,000 | |||
Emp. Name | 50,000 | |||
Emp. Name | 100,000 | |||
Manager #2 | 50,000 | |||
Emp. Name | 25,000 | |||
Emp. Name | 75,000 |
<tbody>
</tbody>
Code:
Dim rng1 As Range Dim rng2 As Range
Set rng1 = pvt.PivotFields("Avg Salary").DataRange
Set rng2 = pvt.RowFields("Employees").DataRange.EntireRow
Intersect(rng1, rng2).Font.Color = vbRed
This is what I want the code to do.
Values | ||||
Row Labels | Avg. Salary | Data #1 | Data #2 | Data #3 |
Manager #1 | 75,000 | |||
Emp. Name | 50,000 | |||
Emp. Name | 100,000 | |||
Manager #2 | 50,000 | |||
Emp. Name | 25,000 | |||
Emp. Name | 75,000 |
<tbody>
</tbody>
Any help being able to find the correct intersect would be much appreciated.