Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
LC
 
Posts: n/a
Default Is it possible to change colors of cells based on value in cell (.

I would like to have the background of cell automatically shaded in grey
level based on the value contained in the cell (values between 0-255).
0 would correspond to Black
255 to white
  #2   Report Post  
Bob Phillips
 
Posts: n/a
Default

Conditional formatting - see http://www.contextures.com/xlCondFormat01.html

--
HTH

-------

Bob Phillips
"LC" wrote in message
...
I would like to have the background of cell automatically shaded in grey
level based on the value contained in the cell (values between 0-255).
0 would correspond to Black
255 to white



  #3   Report Post  
Michael
 
Posts: n/a
Default

Hi LC
Highlight all cells you want to be affected by the condition
Click on Format/Conditional Formatting
Cell value between 0 and 255, set your formats, Click Add
Cell value greater than 255, set your formats, Click Add
Click OK

HTH
Michael

"LC" wrote:

I would like to have the background of cell automatically shaded in grey
level based on the value contained in the cell (values between 0-255).
0 would correspond to Black
255 to white

  #4   Report Post  
JulieD
 
Posts: n/a
Default

Hi

so if the cell value was 0 you want black, if it was 128 you want a mid-grey
and if it was 255 you want white - with all graduations between?

if this is so, i don't think excel will show the graduations as distinct as
you wish, but you could try the following code:

Private Sub Worksheet_Change(ByVal Target As Range)

Dim gcolour As Long

If Target.Address = "$K$4" And Target.Value < "" Then
gcolour = Target.Value
Target.Interior.Color = RGB(gcolour, gcolour, gcolour)
End If
End Sub

---
to use the code, right mouse click on the sheet tab of the sheet you want
the code to work in, choose view code and paste this code on the right hand
side of the screen.
change the K4 to the cell you're interested in formatting.

Cheers
JulieD

"LC" wrote in message
...
I would like to have the background of cell automatically shaded in grey
level based on the value contained in the cell (values between 0-255).
0 would correspond to Black
255 to white



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
is it possible to change print ink color based on cell value? Dave The Mechanic Excel Discussion (Misc queries) 1 January 5th 05 10:54 PM
GET.CELL Biff Excel Worksheet Functions 2 November 24th 04 07:16 PM
Modify Row & Cell Contents based upon Cells Values bpat1434 Excel Worksheet Functions 0 November 7th 04 03:31 PM
Modify Row & Cell Contents based upon Cells Values bpat1434 Excel Worksheet Functions 1 November 7th 04 12:43 PM
Modify Row & Cell Contents based upon Cells Values bpat1434 Excel Worksheet Functions 1 November 6th 04 05:17 PM


All times are GMT +1. The time now is 09:53 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"