Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Setting cell colors using variables
The following code colors my cells fine, but I want to specify the color
using a variable in the stmts so I can color cells differently. Sheets(ToSht).Range(AcctTbl)(i, j).Interior.ThemeColor = lThemeColorAccent1 Sheets(ToSht).Range(AcctTbl)(i, j).Interior.TintAndShade = 0.799981688894314 I tried the following, but get type mismatch errors. What is the proper code? Dim AcctCellColorTheme As String, AcctCellColor As String AcctCellColorTheme = "xlThemeColorAccent1" AcctCellColor = "0.799981688894314" Sheets(ToSht).Range(AcctTbl)(i, j).Interior.ThemeColor = AcctCellColorTheme Sheets(ToSht).Range(AcctTbl)(i, j).Interior.TintAndShade = AcctCellColor I appreciate your help, -John |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Dynamically setting CELL COLORS based on TWO OTHER cell values | Excel Discussion (Misc queries) | |||
Setting cell colors using RGB( ) function | Excel Programming | |||
Setting RGB colors for a set of cells. | Excel Programming | |||
MY 2003 Excel does not show cell colors. Solution? Setting? | Excel Discussion (Misc queries) | |||
Setting colors for Controls | Excel Programming |