Notice: Undefined offset: 2 in /home2/icentarb/public_html/icentar/classes/class.permissions.php on line 735
Const HLColor As Long = 13434879
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Dim r As Range, rcol As Range, rrow As Range
Set r = Me.Range("A1:Z500")
If Intersect(Target, r) Is Nothing Then Exit Sub
Set rcol = Intersect(r, Target.EntireColumn)
Set rrow = Intersect(r, Target.EntireRow)
With Target
If .Count > 1 Then Exit Sub
r.FormatConditions.Delete
With rrow
.FormatConditions.Add Type:=xlExpression, Formula1:="TRUE"
.FormatConditions(1).Interior.Color = HLColor
End With
With rcol
.FormatConditions.Delete
.FormatCondition