
Originally Posted by
vermaccio
...thank you but i would prefer to avoid macro.
I've been working doubles for a couple of days, just got back on this last night. I see torachan beat me to it, and vermaccio's not interested, but here's my VBA code. This has 2 extra features; the bar responds to changes in EITHER column, and it handles multiple pasted entries.
Private Sub Worksheet_Change(ByVal Target As Range)
Dim MCL As Range, KCL As Range
With Range(Cells(6, "K"), Cells(Rows.Count, "K").End(xlUp))
Set Target = Intersect(Target, .Offset(0, 2))
End With
If Not Target Is Nothing Then
For Each MCL In Target
Set KCL = MCL.Offset(0, -2)
With MCL.FormatConditions
.Delete
With .AddDatabar
.MinPoint.Modify xlConditionValueNumber, 0
.MaxPoint.Modify xlConditionValueFormula, "=" & KCL.Address
.BarFillType = xlDataBarFillSolid
If KCL > 0 Then
.BarColor.Color = RGB(255, 85, 90)
End If
If KCL < MCL Then
.BarColor.Color = RGB(255, 0, 0)
End If
End With
End With
Next
End If
End Sub
Bookmarks