Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Counting by colour dilemma!!


Thanks Cripbd for your reply, i don't know whether that will work a
when i try to run my Auto_open i get a runtime error 13 type mismatc
in the Msgbox line where i have cccount it shows error 2015 when th
cursor is placed over it......any ideas?


Simo

--
Simon Lloy
-----------------------------------------------------------------------
Simon Lloyd's Profile: http://www.excelforum.com/member.php...nfo&userid=670
View this thread: http://www.excelforum.com/showthread.php?threadid=27633

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 52
Default Counting by colour dilemma!!

You won't want to refer to the activecell in your code that goes through a range
without selecting...

Function CountByColor(InRange As Range, WhatColorIndex As Integer, _
Optional OfText As Boolean = False) As Long
Dim Rng As Range
Application.Volatile True

For Each Rng In InRange.Cells
If IsError(Rng.Value) Then
'skip it
ElseIf IsDate(Rng) Then
If OfText = True Then
CountByColor = CountByColor - _
(Rng.Font.ColorIndex = WhatColorIndex)
Else
CountByColor = CountByColor - _
(Rng.Interior.ColorIndex = WhatColorIndex)
End If
End If
Next Rng

End Function


Simon Lloyd wrote:

Thanks Cripbd for your reply, i don't know whether that will work as
when i try to run my Auto_open i get a runtime error 13 type mismatch
in the Msgbox line where i have cccount it shows error 2015 when the
cursor is placed over it......any ideas?

Simon

--
Simon Lloyd
------------------------------------------------------------------------
Simon Lloyd's Profile: http://www.excelforum.com/member.php...fo&userid=6708
View this thread: http://www.excelforum.com/showthread...hreadid=276337


--

Dave Peterson

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
Counting cells according to their colour ALawes Excel Discussion (Misc queries) 5 January 22nd 09 08:20 PM
Counting by colour davethewelder Excel Discussion (Misc queries) 6 August 20th 08 10:14 AM
Counting colour fills Jonah Excel Discussion (Misc queries) 2 December 21st 06 01:11 AM
Counting by colour dilemma!! crispbd[_17_] Excel Programming 0 November 8th 04 07:51 PM
Counting Function Dilemma Simon Lloyd Excel Worksheet Functions 0 November 8th 04 03:13 PM


All times are GMT +1. The time now is 06:06 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"