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
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