Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Steve1154
 
Posts: n/a
Default countif cell pattern =


Hi
I need to count cells that display a pattern xlsemigray75 in a range(eg
c3:c300)
any ideas would be appreciated
Steve


--
Steve1154
------------------------------------------------------------------------
Steve1154's Profile: http://www.excelforum.com/member.php...o&userid=31550
View this thread: http://www.excelforum.com/showthread...hreadid=512457

  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
George
 
Posts: n/a
Default countif cell pattern =

Steve1154 wrote:
Hi
I need to count cells that display a pattern xlsemigray75 in a range(eg
c3:c300)
any ideas would be appreciated
Steve


Copy this function into a module

Function countGray75(rng As Range) As Long
Dim c As Range
countGray75 = 0
For Each c In rng
If c.Interior.Pattern = xlPatternGray75 Then
countGray75 = countGray75 + 1
End If
Next
End Function

Then use the formula =countGray75(C3:C300) in your spreadsheet
Of course you can use any range

Since the custom function updates when a cell in that range has its data
modified (not it's pattern), you may need to just edit a cell in the
range of your function and just press enter. This will trigger off the
custom function to calculate.

Some strange behavior by excel;
Using format painter tool anywhere on sheet, function calculated
Using Fill color tool anywhere on sheet, function DID NOT calculate

Even making the function volatile didn't help when using the fill color
tool.

Well, i hope it helps

George
  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Steve1154
 
Posts: n/a
Default countif cell pattern =


That works a treat George. The function runs without any need for data
to be added! And with the use of custom function you have given me an
insight into solving another couple of Problems Cheers
Steve


--
Steve1154
------------------------------------------------------------------------
Steve1154's Profile: http://www.excelforum.com/member.php...o&userid=31550
View this thread: http://www.excelforum.com/showthread...hreadid=512457

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
copying cell names Al Excel Discussion (Misc queries) 12 August 11th 05 03:01 PM
COUNTIF less than cell reference stevepain Excel Discussion (Misc queries) 3 July 12th 05 04:17 PM
cell color index comparison MINAL ZUNKE New Users to Excel 1 June 30th 05 07:11 AM
COUNTIF cell A1 is x and cell B1 is y Heather Murch Excel Worksheet Functions 2 February 17th 05 09:02 PM
Countif cell color is Red? JohnG Excel Worksheet Functions 6 February 11th 05 03:24 PM


All times are GMT +1. The time now is 07:20 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"