Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1
Default Conditional Formatting

I am using a VB code for the worksheet to change cell color if a certain
number is entered.
Private Sub Worksheet_Change(ByVal Target As RANGE)
Dim icolor As Integer

If Not Intersect(Target, RANGE("D12:D26")) Is Nothing Then
Select Case Target
Case 0.09 To 0.869
icolor = 3 'RED'
Case 0.87 To 0.899
icolor = 36 'Light Yellow'
Case 0.9 To 0.939
icolor = 35 'Light Green'
Case 0.94 To 0.969
icolor = 37 'Pale Blue'
Case 0.97 To 1
icolor = 44 'Gold'
End Select

Target.Interior.ColorIndex = icolor
End If

I am taking an average of the range above. In Cell D28 I have this formula:
=IF(ISERROR(AVERAGE(D12:D26)),0,(AVERAGE(D12:D26)) )
Now I would like for this cell to change color according to the average
similar to the VB code for the worksheet, such as if the average is .09 to
..869, then the cell color would be €˜RED, etc. Right now all I get is the
value, not the color also. Can anyone help?

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
Conditional Formatting when inserting a row zahoulik Excel Worksheet Functions 2 January 7th 06 03:01 PM
Conditional Formatting Error ddate Excel Worksheet Functions 0 May 5th 05 09:00 PM
difficulty with conditional formatting Deb Excel Discussion (Misc queries) 0 March 23rd 05 06:13 PM
Determine cells that drive conditional formatting? Nicolle K. Excel Discussion (Misc queries) 2 January 7th 05 01:08 AM
Conditional formatting not available in Excel BAB Excel Discussion (Misc queries) 2 January 1st 05 03:33 PM


All times are GMT +1. The time now is 10:20 AM.

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"