Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 5
Default Couting based on color and Filter

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

  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 527
Default Couting based on color and Filter

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
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
Advance Filter can be based on cell Color in Microsoft Excel Prateek Singhal New Users to Excel 2 August 23rd 07 04:38 AM
Couting the number of referrences that... speakers_86 Excel Worksheet Functions 11 July 28th 06 03:52 AM
couting based on age from today mlobitz Excel Discussion (Misc queries) 1 February 13th 06 04:36 PM
couting transactions for same time kdp145 Excel Worksheet Functions 1 December 15th 05 04:50 PM
How do I filter based on color in Excel? Howieben Excel Worksheet Functions 1 June 28th 05 01:28 PM


All times are GMT +1. The time now is 05:18 PM.

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"