Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 18
Default Assigning a color to a cell

I saw some other post about kind of the same problem but not this way.

I have a risk evaluation formula in a cell. Output range is between 1 and 9

If between 1 and 3, I want to assign the color lightgreen to it
If between 4 and 6 I want to assign the color yellow to it
and red if 7 to 9.

Is this possible within the Function use ? If not, How can I apply that
automatically ? a macro ? How ?


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default Assigning a color to a cell

Use the Conditional Formatting tool from the Format menu.


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com


"Junkyard Engineer" wrote in
message ...
I saw some other post about kind of the same problem but not
this way.

I have a risk evaluation formula in a cell. Output range is
between 1 and 9

If between 1 and 3, I want to assign the color lightgreen to it
If between 4 and 6 I want to assign the color yellow to it
and red if 7 to 9.

Is this possible within the Function use ? If not, How can I
apply that
automatically ? a macro ? How ?




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 206
Default Assigning a color to a cell

you could define
Private Sub Worksheet_Change(ByVal Target As Range)

If Range("j48").Value 0 And Range("j48").Value < 4 Then
Range("j48").Interior.ColorIndex = 35
ElseIf Range("j48").Value 3 And Range("j48").Value < 7 Then
Range("j48").Interior.ColorIndex = 36
Else
Range("j48").Interior.ColorIndex = 3
End If
end sub

on the code of the worksheet and change the argument of Range to the value
of the cell you want

there's probably a much better way to do this, and i'm sure someone will
point it out

"Junkyard Engineer" wrote:

I saw some other post about kind of the same problem but not this way.

I have a risk evaluation formula in a cell. Output range is between 1 and 9

If between 1 and 3, I want to assign the color lightgreen to it
If between 4 and 6 I want to assign the color yellow to it
and red if 7 to 9.

Is this possible within the Function use ? If not, How can I apply that
automatically ? a macro ? How ?



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 18
Default Assigning a color to a cell

Ok, that one is interesting because conditional formatting only allows 3
arguments..

thanks

"Gixxer_J_97" a écrit dans le message
de ...
you could define
Private Sub Worksheet_Change(ByVal Target As Range)

If Range("j48").Value 0 And Range("j48").Value < 4 Then
Range("j48").Interior.ColorIndex = 35
ElseIf Range("j48").Value 3 And Range("j48").Value < 7 Then
Range("j48").Interior.ColorIndex = 36
Else
Range("j48").Interior.ColorIndex = 3
End If
end sub

on the code of the worksheet and change the argument of Range to the value
of the cell you want

there's probably a much better way to do this, and i'm sure someone will
point it out

"Junkyard Engineer" wrote:

I saw some other post about kind of the same problem but not this way.

I have a risk evaluation formula in a cell. Output range is between 1

and 9

If between 1 and 3, I want to assign the color lightgreen to it
If between 4 and 6 I want to assign the color yellow to it
and red if 7 to 9.

Is this possible within the Function use ? If not, How can I apply that
automatically ? a macro ? How ?





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
Assigning Color to a number kb489 Excel Discussion (Misc queries) 3 December 2nd 09 09:41 PM
Assigning Color in If Function Mary Fetsch Excel Worksheet Functions 2 February 6th 08 03:23 PM
assigning a value to a cell Braheem Excel Worksheet Functions 3 September 13th 06 04:42 AM
assigning macro to cell Adam Excel Programming 6 April 22nd 05 05:19 PM
Assigning a shape to cell Sarah W Excel Programming 1 September 27th 04 12:33 AM


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

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"