Option Explicit
Private Sub Worksheet_Change(ByVal Target As Range)
'Format a range of cells based on drop selection
If Target.Count > 1 Then Exit Sub
If Not Intersect(Target, Range("C6:IV6")) Is Nothing Then
Dim i As Integer, v As Integer, c As Variant
i = Target.Column
v = 14 'add row variance
Range(Cells(15, i), Cells(45, i)).Interior.ColorIndex = xlNone
Select Case Target.Value
Case "Condition A" 'Orange
For Each c In Array(1, 2, 7, 11, 15) 'Enter Step #s
Range(Cells(c + v, i), Cells(c + v, i)).Interior.ColorIndex = 40
Next c
Case "Condition B" 'Lite Green
For Each c In Array(2, 5, 9, 11, 16, 21, 25, 28, 30)
Range(Cells(c + v, i), Cells(c + v, i)).Interior.ColorIndex = 35
Next c
Case "Condition C" 'Lite Blue
For Each c In Array(1, 4, 9, 11, 16, 17, 18, 19, 22, 27, 30)
Range(Cells(c + v, i), Cells(c + v, i)).Interior.ColorIndex = 37
Next c
Case "Condition D" 'Lavender
For Each c In Array(3, 8, 9, 10, 12, 13, 19, 20, 24, 29)
Range(Cells(c + v, i), Cells(c + v, i)).Interior.ColorIndex = 39
Next c
Case "Condition E" 'Pink
For Each c In Array(6, 7, 8, 13, 14, 17, 19, 20, 23, 28, 31)
Range(Cells(c + v, i), Cells(c + v, i)).Interior.ColorIndex = 38
Next c
Case "Condition F" 'Grey
For Each c In Array(1, 10, 20, 30, 31)
Range(Cells(c + v, i), Cells(c + v, i)).Interior.ColorIndex = 15
Next c
Case Else
End Select
End If
End Sub
Bookmarks