PC Review


Reply
Thread Tools Rate Thread

Couting based on color and Filter

 
 
Aslam
Guest
Posts: n/a
 
      25th Jun 2008
hi

I have a data more than 1000 rows, most of them highlited with
different colours, my question is: Is it possible to count based on
specific highlited colours for example yellow= 50 row, blue= 70, red
=105.

In addition to this, in excel-2003 the auto-filter does not display
more that 1000 row, is it have any solution

thanks

 
Reply With Quote
 
 
 
 
Billy Liddel
Guest
Posts: n/a
 
      25th Jun 2008
You need to create VB functions for working with colours. Copy these into a
VB Module ALT + F11, Insert Module then paste:

This returns the index number of the cell in the reference. Use this number
tin the following functions.

Function cellColorIndx(ByVal ref) As Variant
If ref.Interior.ColorIndex = xlNone Then
cellColorIndx = "No Cell color"
Else
cellColorIndx = ref.Interior.ColorIndex
End If
End Function


Function sumColour(ByVal ref As Range, ind As Integer)
'Add the values of the cells with the same index number
Dim c
For Each c In ref
If c.Interior.ColorIndex = ind Then
If IsError(c) Or Not IsNumeric(c) Then
sumColour = sumColour
Else
sumColour = sumColour + c
End If
End If
Next
End Function
Function CountColour(ByVal ref As Range, ind As Integer)
' Count the cells formatted with the index number
Dim c
For Each c In ref
If c.Interior.ColorIndex = ind Then
If IsError(c) Or Not IsNumeric(c) Then
CountColour = CountColour
Else
CountColour = CountColour + 1
End If
End If
Next
End Function

Perhaps someone else can answer the filter question, But I seem to remember
that www.Contextures.com has an article on it where you use sucessive filters
to narrow the range

Regards
Peter

"Aslam" wrote:

> hi
>
> I have a data more than 1000 rows, most of them highlited with
> different colours, my question is: Is it possible to count based on
> specific highlited colours for example yellow= 50 row, blue= 70, red
> =105.
>
> In addition to this, in excel-2003 the auto-filter does not display
> more that 1000 row, is it have any solution
>
> thanks
>
>

 
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
Couting rows based on given data range navin Microsoft Excel Discussion 1 13th May 2009 05:19 PM
auto filter based on color Alan Ku Microsoft Excel Programming 1 3rd Jan 2008 07:05 AM
couting based on age from today mlobitz Microsoft Excel Misc 1 13th Feb 2006 04:36 PM
How do I filter based on color in Excel? =?Utf-8?B?SG93aWViZW4=?= Microsoft Excel Worksheet Functions 1 28th Jun 2005 01:28 PM
Problem - Filter based on color? Nephilim Microsoft Excel Programming 2 23rd Jan 2004 11:17 AM


Features
 

Advertising
 

Newsgroups
 


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