VBA Code:
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Selection.Worksheet.Cells.FormatConditions.Delete
Rows(ActiveCell.Row).FormatConditions.Add xlExpression, , "TRUE"
Rows(ActiveCell.Row).FormatConditions(1).Interior.Color = RGB(255, 128, 128)
Columns(ActiveCell.Column).FormatConditions.Add xlExpression, , "TRUE"
Columns(ActiveCell.Column).FormatConditions(2).Interior.Color = RGB(0, 204, 255)
End Sub
hello everyone. these codes work fine in showing row and columns highlighted when I select any cell. but how to give selected cell different color.