Here is better code that fixes the border coloring issue. Place this behind Sheet1 for ex.
or we can change the code to run from a module on all sheets.
VB Code:
Private Sub Worksheet_SelectionChange(ByVal Target As Range) If Range("E39").Value < 100 Then With Range("G39").Interior .ColorIndex = 3 .Pattern = xlSolid .PatternColorIndex = xlAutomatic End With Else With Range("G39") .Interior.ColorIndex = 0 .Interior.Pattern = xlSolid .Interior.PatternColorIndex = xlAutomatic .Borders(xlDiagonalDown).LineStyle = xlNone .Borders(xlDiagonalUp).LineStyle = xlNone .Borders(xlEdgeLeft).LineStyle = xlNone .Borders(xlEdgeTop).LineStyle = xlNone .Borders(xlEdgeBottom).LineStyle = xlNone .Borders(xlEdgeRight).LineStyle = xlNone .Interior.ColorIndex = xlNone End With End If End Sub![]()





Reply With Quote