Option
Explicit
Private
Sub
Worksheet_SelectionChange(
ByVal
Target
As
Range)
Dim
symbol1
As
String
Dim
symbol2
As
String
Dim
color1
As
String
Dim
color2
As
String
symbol1 = ChrW(9679)
color1 = 0
symbol2 = ChrW(9676)
color2 = 4
Dim
rngArea
As
Excel.Range
Dim
rngCell
As
Excel.Range
Set
Target = Target.Cells(1)
For
Each
rngArea
In
Range(
"A1:G1,A3:G3"
).Areas
If
rngArea.Row <= Target.Row
And
Target.Row <= (rngArea.Row + rngArea.Rows.Count) _
And
rngArea.Column <= Target.Column
And
Target.Column <= (rngArea.Column + rngArea.Columns.Count) _
Then
Application.EnableEvents =
False
For
Each
rngCell
In
rngArea.Cells
If
rngCell.Address <> Target.Address
Then
rngCell.Value = symbol2
Else
rngCell.Value = symbol1
End
If
Next
Application.EnableEvents =
True
Exit
For
End
If
Next
End
Sub