View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
spolk[_8_] spolk[_8_] is offline
external usenet poster
 
Posts: 1
Default Changing cell color based on its value

Hi I'am trying to create a macro which should change the backround colo
of a cell based on its value in column B. My code is going through, bu
it does't do any coloring, whats wrong, am I somehow wrong referring t
to the column B?


Sub ColorCellBasedOnCellValue()
'Colors a cell in column based on its value
Application.ScreenUpdating = False
Application.Calculation = xlCalculationManual
Dim cell As Range
For Each cell In Cells(Rows.Count, "B")
Select Case cell.Value
Case Is = 20
cell.Interior.ColorIndex = 7
Case Is = 0
cell.Interior.ColorIndex = 7


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

--
Message posted from http://www.ExcelForum.com