Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Private Sub Worksheet_Change(ByVal Target As Range)
- If Target.Count > 1 Then Exit Sub
- If Not Intersect(Range("a33", "f36"), Target) Is Nothing Then
- setColor Target.Column
- End If
- End Sub
- Sub setColor(col As Integer)
- Dim vDB, vColor
- Dim i As Integer, c As Integer, n As Integer
- vColor = Array(RGB(244, 185, 79), RGB(0, 180, 255), RGB(255, 54, 54), RGB(116, 211, 109))
- Range(Cells(1, col), Cells(32, col)).Interior.Color = RGB(36, 36, 36)
- vDB = Cells(33, col).Resize(4)
- For i = 1 To 4
- n = vDB(i, 1)
- c = c + n
- If IsEmpty(n) Then
- Else
- Cells(32, col).Offset(-c, 0).Resize(n).Interior.Color = vColor(i - 1)
- End If
- Next i
- End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement