M
Miron
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??
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??