Conditional formatting on pivot table to track positive or negative change

Netatthis

New Member
Joined
Jun 17, 2014
Messages
2
Hi,
I am struggling with some vba code, I am quite new at this so please bear with me.
I have a pivot table for a sales pipeline which updates from MS CRM online 2013. I would like to conditional format the opportunities that changed from one sales meeting the next.

That is to say, if a sales rep is closer to a sale than before. The problem is target.value > target.Offset I cant figure out how to get the code to target the right range and compare it to the previous values.
I have the following code:

/Private Sub Worksheet_Change(ByVal Target As Range)

' Application.EnableEvents = False
' 'Application.ScreenUpdating = False
'
' If Not Intersect(Target, Range("F8:F51")) Is Nothing Then
' Debug.Print Target.Address
' If Target.Value > Target.Offset(, 4).Value Then
' Target.FormatConditions.AddIconSetCondition
' With Target.FormatConditions(1)
' .IconSet = ActiveWorkbook.IconSets(xlIconGreenUpArrow)
' End With
' ElseIf Target.Value < Target.Offset(, 4).Value Then
' Target.FormatConditions.AddIconSetCondition
' With Target.FormatConditions(1)
' .IconSet = ActiveWorkbook.IconSets(xlIconRedDownArrow)
' End With
' Else
' Target.FormatConditions.AddIconSetCondition
' With Target.FormatConditions(1)
' .IconSet = ActiveWorkbook.IconSets(xlIconYellowSideArrow)
' End With
' End If
' Target.Value = Target.Offset(, 4).Value
'
'
' End If
' 'Application.ScreenUpdating = True
' Application.EnableEvents = True
End Sub


Sub df()
Application.EnableEvents = True
End Sub


/
I thought I could ask the experts here to see if I am on the right track and where to go from here
 

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top