ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   coloring a cell only if there is a value entered in it (https://www.excelbanter.com/excel-programming/371928-coloring-cell-only-if-there-value-entered.html)

j.kuhnke

coloring a cell only if there is a value entered in it
 
I need to automatically fill (w/ color) cells, only if a value is entered in
it, otherwise i would like them to stay white. big time saver for the
formatting that i have to do.

aka, when i type in a number, the cell automatically colors. if the number
is 1 i need the cell to be red, if 2 i need the cell to be yellow, if 3 i
need it to be blue.

moon[_6_]

coloring a cell only if there is a value entered in it
 


Private Sub Worksheet_Change(ByVal Target As Range)
Select Case Target.Value
Case 1:
Target.Interior.ColorIndex = 3
Case 2:
Target.Interior.ColorIndex = 6
Case 3:
Target.Interior.ColorIndex = 5
Case Else:
'do nothing
End Select
End Sub



"j.kuhnke" schreef in bericht
...
I need to automatically fill (w/ color) cells, only if a value is entered
in
it, otherwise i would like them to stay white. big time saver for the
formatting that i have to do.

aka, when i type in a number, the cell automatically colors. if the number
is 1 i need the cell to be red, if 2 i need the cell to be yellow, if 3 i
need it to be blue.




Gord Dibben

coloring a cell only if there is a value entered in it
 
FormatConditional Formatting.

You can have up to 3 conditions, 4 if you count default.

For an add-in that will give you up to 30 conditions see Bob Phillips' site.

http://www.xldynamic.com/source/xld.....Download.html


Gord Dibben MS Excel MVP

On Thu, 31 Aug 2006 16:37:01 -0700, j.kuhnke
wrote:

I need to automatically fill (w/ color) cells, only if a value is entered in
it, otherwise i would like them to stay white. big time saver for the
formatting that i have to do.

aka, when i type in a number, the cell automatically colors. if the number
is 1 i need the cell to be red, if 2 i need the cell to be yellow, if 3 i
need it to be blue.




All times are GMT +1. The time now is 04:16 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com