Hi All,
I want to set the Target as area/region of current region, so that, instead of entire column or entire row, only columns and rows belongs to current region should be highlighted.
Please suggest.
>>> use code - tags <<<
>>> as You've noted earlier <<<
I want to set the Target as area/region of current region, so that, instead of entire column or entire row, only columns and rows belongs to current region should be highlighted.
Please suggest.
>>> use code - tags <<<
>>> as You've noted earlier <<<
Code:
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Dim Area As Range
Set Area = Range("C5").CurrentRegion
Cells.Interior.ColorIndex = xlColorIndexNone
If Target.Row <= Area.Rows.Count And Target.Column <= Area.Columns.Count Then
Target.EntireColumn.Interior.ColorIndex = 4
Target.EntireRow.Interior.ColorIndex = 4
Else
Cells.Interior.Color = xlColorIndexNone
End If
End Sub
Last edited by a moderator: