Vba does recognize when the cell value changes in B7 to R7 because I pull cell value from another worksheet. it only works if I change the cell directly. any suggestions.
[FONT=Verdana,Arial,Tahoma,Calibri,Geneva,sans-serif]Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Cells.Count > 1 Then Exit Sub
Dim rng As Range
Set rng = Range("B7, D7, F7, H7, J7, L7, N7, P7, R7")
If Not Intersect(Target, rng) Is Nothing Then
For Each c In rng
If c < 0 Then
c.Offset(-2).Resize(4).BorderAround xlContinuous, xlMedium, 3
ElseIf c > 0 Then
c.Offset(-2).Resize(4).BorderAround xlContinuous, xlMedium, 4
Else
If Not c.Borders.linestyle = xlNone Then
c.Offset(-2).Resize(4).Borders.linestyle = xlNone
End If
End If
Next
End If
End Sub[/FONT]
[FONT=Verdana,Arial,Tahoma,Calibri,Geneva,sans-serif]Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Cells.Count > 1 Then Exit Sub
Dim rng As Range
Set rng = Range("B7, D7, F7, H7, J7, L7, N7, P7, R7")
If Not Intersect(Target, rng) Is Nothing Then
For Each c In rng
If c < 0 Then
c.Offset(-2).Resize(4).BorderAround xlContinuous, xlMedium, 3
ElseIf c > 0 Then
c.Offset(-2).Resize(4).BorderAround xlContinuous, xlMedium, 4
Else
If Not c.Borders.linestyle = xlNone Then
c.Offset(-2).Resize(4).Borders.linestyle = xlNone
End If
End If
Next
End If
End Sub[/FONT]