Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
counting by colour only if a cell contains a date???
Sorry Peter you have lost me here!, can you explain what it was you wer trying to get me to do? 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=27311 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
counting by colour only if a cell contains a date???
Function CountByColor(InRange As Range, _
WhatColorIndex As Integer, _ Optional OfText As Boolean = False) As Long ' ' This function return the number of cells in InRange with ' a background color, or if OfText is True a font color, ' equal to WhatColorIndex. ' Dim Rng As Range Application.Volatile True For Each Rng In InRange.Cells if 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 -- Regards, Tom Ogilvy "Simon Lloyd" wrote in message ... Sorry Peter you have lost me here!, can you explain what it was you were trying to get me to do? 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=273115 |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
counting by colour only if a cell contains a date???
Sorry Peter you have lost me here!, can you explain what it was you were trying to get me to do? In your previous post you asked: i am unsure how to add a line to the code that will follow the criteria if activecell.value = Date then count and in reply I suggested IsDate(ActiveCell) But I can see now I misread your question, sorry! I thought you wanted to check if the cell contain a valid date rather than than if the cell contains today's date. Regards, Peter |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
counting cell that are fomated a particular fill colour | Excel Discussion (Misc queries) | |||
After a cell changes colour when a date is near | Excel Discussion (Misc queries) | |||
How can i change cell colour depending on month of date in cell? | Excel Discussion (Misc queries) | |||
counting by colour only if a cell contains a date??? | Excel Programming | |||
counting by colour only if a cell contains a date??? | Excel Programming |