|
<p><br/>'Private Sub Worksheet_SelectionChange(ByVal Target As Range)<br/>'Static OldCell As Range</p><p> 'If Not OldCell Is Nothing Then<br/> 'OldCell.EntireRow.Interior.ColorIndex = xlColorIndexNone<br/> 'OldCell.EntireColumn.Interior.ColorIndex = xlColorIndexNone<br/> 'End If<br/> 'Target.EntireRow.Interior.ColorIndex = 24<br/> 'Target.EntireColumn.Interior.ColorIndex = 24<br/> 'Set OldCell = Target<br/>'End Sub<br/>Private Sub Worksheet_SelectionChange(ByVal Target As Excel.Range)<br/> If Target.Row >= 2 Then<br/> On Error Resume Next<br/> [ChangColor_With2].FormatConditions.Delete<br/> [ChangColor_With3].FormatConditions.Delete<br/> Target.EntireRow.Name = "ChangColor_With2"<br/> Target.EntireColumn.Name = "ChangColor_With3"<br/> With [ChangColor_With2].FormatConditions<br/> .Delete<br/> .Add xlExpression, , "TRUE"<br/> .Item(1).Interior.ColorIndex = 24<br/> End With<br/> With [ChangColor_With3].FormatConditions<br/> .Delete<br/> .Add xlExpression, , "TRUE"<br/> .Item(1).Interior.ColorIndex = 24<br/> End With<br/> End If<br/>End Sub<br/></p> |
|