i found this code, it doesnt change the original highlighted color
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
ActiveSheet.Rows(Target.Row).Select ' highlite entire row
Target.Activate ' select the cell
End Sub
i found this code, it doesnt change the original highlighted color
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
ActiveSheet.Rows(Target.Row).Select ' highlite entire row
Target.Activate ' select the cell
End Sub
And following can be used to highlight row and column both
Code:Private Sub Worksheet_SelectionChange(ByVal Target As Range) Application.EnableEvents = False Range(Target.EntireRow.Address & "," & Target.EntireColumn.Address).Select 'OR Union(Target.EntireRow, Target.EntireColumn).Select Target.Activate Application.EnableEvents = True End Sub
Last edited by Transformer; 04-29-2013 at 05:08 PM.
Regards,
Transformer
You can check cells count.
Code:Private Sub Worksheet_SelectionChange(ByVal Target As Range) If Target.Cells.Count >= 2 Then Exit Sub Application.EnableEvents = False Range(Target.EntireRow.Address & "," & Target.EntireColumn.Address).Select 'OR Union(Target.EntireRow, Target.EntireColumn).Select Target.Activate Application.EnableEvents = True End Sub
Last edited by Transformer; 07-31-2013 at 06:48 AM.
Regards,
Transformer
Bookmarks