我有以下代码,它完美无缺。但是,我想将一些典型的颜色数字改为主题颜色,并且它不与我合作。
标签1: .ThemeColor = xlThemeColorAccent3 .TintAndShade = -0.249977111117893
标签2:192
标签3: .ThemeColor = xlThemeColorLight2 .TintAndShade = -0.249977111117893
等等,但我似乎无法找到在数组中格式化它的正确方法。任何帮助都会很棒!
Sub Change_Tab_Colors_Based_On_Array()
'
' Change_Tab_Colors_Based_On_Array Macro
'
' Declaration
Dim iCntr, sht, arrColors, numColors
' Define the Array of Colors for Tabs - Repeats
arrColors = Array(10, 9, 23, 46, 44, 50, 48)
iCntr = 0
numColors = UBound(arrColors) + 1
' Loop Through All Sheets in Workbook
For Each sht In ThisWorkbook.Worksheets
sht.Tab.ColorIndex = arrColors((iCntr Mod 7))
iCntr = iCntr + 1
Next
End Sub