View Single Post
 
Old 04-28-2018, 08:43 AM
Logit Logit is offline Windows 10 Office 2007
Expert
 
Join Date: Jan 2017
Posts: 591
Logit is a jewel in the roughLogit is a jewel in the roughLogit is a jewel in the roughLogit is a jewel in the rough
Default

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
Reply With Quote