forked from farishadi/Excel_Macro_References
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathColorizeCells
More file actions
35 lines (32 loc) · 1.17 KB
/
Copy pathColorizeCells
File metadata and controls
35 lines (32 loc) · 1.17 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
'sub colorizes range based on startrow, startcol, endrow, endcol
Public Sub colorizeCells(ByVal lStartRow As Long, ByVal iStartCol As Integer, ByVal lEndRow As Long, ByVal iEndCol As Integer, ByVal iClrSwtch As Integer)
'iClrSwtch controls color that goes into range
If iClrSwtch = 1 Then
'BLUE
With Range(Cells(lStartRow, iStartCol), Cells(lEndRow, iEndCol)).Interior
.Pattern = xlSolid
.PatternColorIndex = xlAutomatic
.ThemeColor = xlThemeColorAccent1
.TintAndShade = 0.599993896298105
.PatternTintAndShade = 0
End With
ElseIf iClrSwtch = 2 Then
'GREY
With Range(Cells(lStartRow, iStartCol), Cells(lEndRow, iEndCol)).Interior
.Pattern = xlSolid
.PatternColorIndex = xlAutomatic
.ThemeColor = xlThemeColorDark2
.TintAndShade = 0
.PatternTintAndShade = 0
End With
ElseIf iClrSwtch = 3 Then
'DARK GREY
With Range(Cells(lStartRow, iStartCol), Cells(lEndRow, iEndCol)).Interior
.Pattern = xlSolid
.PatternColorIndex = xlAutomatic
.ThemeColor = xlThemeColorDark1
.TintAndShade = -0.249977111117893
.PatternTintAndShade = 0
End With
End If
End Sub