V
visual73
Hello,
I want to create a form with button. The button must be coloured in one from
color theme Excel_2007.
I can get base color theme (10 color: XlThemeColor):
Dim Color (1 To 10) As Integer
Dim Scheme As ThemeColorScheme
Set Scheme = ActiveWorkbook.Theme.ThemeColorScheme
For Color = 1 To 10
X(Color) = Scheme(Color).RGB
Next
Set Scheme= Nothing
'and
MyForm.MyButton.BackColor=X(3) '(for example)
X -array that have 10 color active theme.
But I need to define more colors in palette (50 derivative of base colors).
If I deal with cell that I can use:
Range("A1").Select
With Selection.Interior
.ThemeColor=xlThemeColorAccent1 '(for example)
.TintAndShade = 0.8 '(take on a value from 1 to -1). We to define
any from derivative of base colors
End With
But Button have not ".TintAndShade" property! May be if I know X and
TintAndShade value, can I to calculate result color?
P.S. I can be coloured cells in 60 color. Then I can to recognize RGB for
each cell and give it to button. But it not correctly way.
I want to create a form with button. The button must be coloured in one from
color theme Excel_2007.
I can get base color theme (10 color: XlThemeColor):
Dim Color (1 To 10) As Integer
Dim Scheme As ThemeColorScheme
Set Scheme = ActiveWorkbook.Theme.ThemeColorScheme
For Color = 1 To 10
X(Color) = Scheme(Color).RGB
Next
Set Scheme= Nothing
'and
MyForm.MyButton.BackColor=X(3) '(for example)
X -array that have 10 color active theme.
But I need to define more colors in palette (50 derivative of base colors).
If I deal with cell that I can use:
Range("A1").Select
With Selection.Interior
.ThemeColor=xlThemeColorAccent1 '(for example)
.TintAndShade = 0.8 '(take on a value from 1 to -1). We to define
any from derivative of base colors
End With
But Button have not ".TintAndShade" property! May be if I know X and
TintAndShade value, can I to calculate result color?
P.S. I can be coloured cells in 60 color. Then I can to recognize RGB for
each cell and give it to button. But it not correctly way.