Code:
Option Explicit
Dim rng As Range, ray
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Dim Dn As Range, c As Long, col As Long
col = 100
If Not rng Is Nothing Then
c = 0
For Each Dn In rng
c = c + 1
Dn.Interior.Color = ray(c, 1)
Next Dn
End If
c = 0
Set rng = Cells(Target.Row, 1).Resize(, col)
ReDim ray(1 To rng.Count, 1 To 2)
For Each Dn In rng
c = c + 1
ray(c, 1) = Dn.Interior.Color
Next Dn
Cells(Target.Row, 1).Resize(, col).Interior.ColorIndex = 15
End Sub