LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Setting RGB colors for a set of cells.

Hi
Iv got a huge problem with setting RGB colors in excel for difrent
cells
take a look on my script:

Sub ColorCellBasedOnCellValue()

Application.ScreenUpdating = False
Application.Calculation = xlCalculationManual
Dim cell As Range
For Each cell In Intersect(Selection, ActiveCell.EntireColumn,
ActiveSheet.UsedRange)
Select Case cell.Value
Case Is = False
cell.Interior.ColorIndex = 0
Case Else
cell.Interior.color = RGB(CByte("&H" & Right$(cell.Value,
2)), CByte("&H" & Mid$(cell.Value, 3, 2)), CByte("&H" & Left$
(cell.Value, 2)))

End Select
Next cell
Application.Calculation = xlCalculationAutomatic
Application.ScreenUpdating = False
End Sub

It supose to change Hexadecimal code from a cell change it to RGB and
than fill its background with that color. It works, except excel uses
its 56 color palette and puts own closest colors.
I was thinking to change that formula to create a separate palette for
each one color or new palete for every 56 new colors than create new
one until finish (thers 800 difrend codes that i have to change). The
problem is that i dont know how to do it. Can anybody help me with
this??

 
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
Setting dataseries-colors with VBA in XL2007 Holger Gerths Charts and Charting in Excel 1 March 5th 10 07:22 PM
trouble setting colors feh Charts and Charting in Excel 3 July 10th 09 06:08 AM
Dynamically setting worksheet tab colors John Excel Worksheet Functions 4 January 29th 09 06:55 PM
Setting colors of results in a column ERBERB Excel Discussion (Misc queries) 1 October 28th 05 01:21 PM
Setting colors for Controls dsimcox Excel Programming 1 December 2nd 04 04:59 PM


All times are GMT +1. The time now is 10:37 AM.

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

About Us

"It's about Microsoft Excel"