PC Review


Reply
Thread Tools Rate Thread

Cout CF in range that = blue

 
 
=?Utf-8?B?RWxreVNT?=
Guest
Posts: n/a
 
      30th Dec 2006
I have 30 or so rows of data each with about 23 numbers in them. Each cell
in that range has conditional formating in it to see if it is over a target
number. I now need excel to count how man of them are above goal. I am
using colorindex 5 and have some code that will count how many as long as I
just color the cell with the fill icon but for some reason it does not want
to do it when I use CF. I was trying to get away from CF and just write some
loop in a macro that will look to see if it is over goal and then color it
blue, then move on to the next stat but I am not sure that excel can do that.
Any ideas on how I can do this?
 
Reply With Quote
 
 
 
 
=?Utf-8?B?RWxreVNT?=
Guest
Posts: n/a
 
      30th Dec 2006
OK I think I may be getting closer. I just figured out this much:

Sub MaxClose()
'This will do the cell color for Close
Dim i As Integer
i = 1
Do Until i > 30
If Range("H11") > Range("G11") Then
Range("H11").Select
With Selection.Interior
.ColorIndex = 5
.Pattern = xlSolid
End With
Selection.Font.ColorIndex = 2
End If
i = i + 1
Loop
End Sub

That will change the fill color of H11 and I think I have it close to
actually looping to its right 30 time. After it gets all of that then my
code to count fill color works great since it is not using CF. How to I do
the cell.offset so that it will start at h11 and move right = to i ?
"ElkySS" wrote:

> I have 30 or so rows of data each with about 23 numbers in them. Each cell
> in that range has conditional formating in it to see if it is over a target
> number. I now need excel to count how man of them are above goal. I am
> using colorindex 5 and have some code that will count how many as long as I
> just color the cell with the fill icon but for some reason it does not want
> to do it when I use CF. I was trying to get away from CF and just write some
> loop in a macro that will look to see if it is over goal and then color it
> blue, then move on to the next stat but I am not sure that excel can do that.
> Any ideas on how I can do this?

 
Reply With Quote
 
Gord Dibben
Guest
Posts: n/a
 
      30th Dec 2006
See Chip Pearson's site for a Function that can be used to count using CF Colors

http://www.cpearson.com/excel/CFColors.htm


Gord Dibben MS Excel MVP


On Sat, 30 Dec 2006 08:36:01 -0800, ElkySS <(E-Mail Removed)>
wrote:

>I have 30 or so rows of data each with about 23 numbers in them. Each cell
>in that range has conditional formating in it to see if it is over a target
>number. I now need excel to count how man of them are above goal. I am
>using colorindex 5 and have some code that will count how many as long as I
>just color the cell with the fill icon but for some reason it does not want
>to do it when I use CF. I was trying to get away from CF and just write some
>loop in a macro that will look to see if it is over goal and then color it
>blue, then move on to the next stat but I am not sure that excel can do that.
> Any ideas on how I can do this?


 
Reply With Quote
 
Mike Fogleman
Guest
Posts: n/a
 
      30th Dec 2006
Using i as the column number looping to the right 30 columns:

Sub MaxClose()
'This will do the cell color for Close
Dim i As Integer
i = 8 'column H
For i = 8 To 38
If Cells(11, i) > Range("G11") Then
Cells(11, i).Interior.ColorIndex = 5
Cells(11, i).Font.ColorIndex = 2
End If
Next
End Sub

Mike F

"ElkySS" <(E-Mail Removed)> wrote in message
news:303B5535-499A-41AB-8E4F-(E-Mail Removed)...
> OK I think I may be getting closer. I just figured out this much:
>
> Sub MaxClose()
> 'This will do the cell color for Close
> Dim i As Integer
> i = 1
> Do Until i > 30
> If Range("H11") > Range("G11") Then
> Range("H11").Select
> With Selection.Interior
> .ColorIndex = 5
> .Pattern = xlSolid
> End With
> Selection.Font.ColorIndex = 2
> End If
> i = i + 1
> Loop
> End Sub
>
> That will change the fill color of H11 and I think I have it close to
> actually looping to its right 30 time. After it gets all of that then my
> code to count fill color works great since it is not using CF. How to I
> do
> the cell.offset so that it will start at h11 and move right = to i ?
> "ElkySS" wrote:
>
>> I have 30 or so rows of data each with about 23 numbers in them. Each
>> cell
>> in that range has conditional formating in it to see if it is over a
>> target
>> number. I now need excel to count how man of them are above goal. I am
>> using colorindex 5 and have some code that will count how many as long as
>> I
>> just color the cell with the fill icon but for some reason it does not
>> want
>> to do it when I use CF. I was trying to get away from CF and just write
>> some
>> loop in a macro that will look to see if it is over goal and then color
>> it
>> blue, then move on to the next stat but I am not sure that excel can do
>> that.
>> Any ideas on how I can do this?



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
cout =?Utf-8?B?RHVyZ2E=?= Microsoft VC .NET 2 24th Jun 2006 05:03 PM
Slow link when adding std::cout Chris Stankevitz Microsoft VC .NET 0 14th Dec 2005 01:07 AM
cout undefined after #include <iostream> ?! =?Utf-8?B?Tm9ybWFuIERpYW1vbmQ=?= Microsoft VC .NET 14 2nd Apr 2004 12:47 AM
Redirect cout Hai Ly Hoang [MT00KSTN] Microsoft VC .NET 2 8th Dec 2003 01:13 PM
How to cout a newline in a MsgBox? Daniel Microsoft Access VBA Modules 5 30th Oct 2003 08:55 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 12:23 PM.