Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,069
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Dynamically setting CELL COLORS based on TWO OTHER cell values Tom Excel Discussion (Misc queries) 3 February 22nd 09 07:34 PM
Setting cell colors using RGB( ) function haileybury Excel Programming 1 September 17th 08 09:51 PM
Setting RGB colors for a set of cells. Miron Excel Programming 5 April 24th 07 11:48 AM
MY 2003 Excel does not show cell colors. Solution? Setting? WetRiverOak Excel Discussion (Misc queries) 1 August 2nd 06 04:21 AM
Setting colors for Controls dsimcox Excel Programming 1 December 2nd 04 04:59 PM


All times are GMT +1. The time now is 11:29 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"