Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Josh - Westfield Australia
 
Posts: n/a
Default Counting highlighted cells?

Is there a way to count cells in a column which have been highlighted or text
that has been italicised??. As i have a column full of dates, and when
something is completed the suggested date is changed to the actual date,
highlighted and italicised. I need to keep a count on the completed dates.
  #3   Report Post  
Bob Phillips
 
Posts: n/a
Default

There is a solution at
http://www.xldynamic.com/source/xld.ColourCounter.html that shows how to
count coloured text/cells. Frank Kabel wrote a textstyle function that we
used in this concept, which is given below

'---------------------------------------------------------------------------
Function TextStyle(rng As Range, _
Optional iStyle As Integer = 1) As Variant
'---------------------------------------------------------------------------
Dim cell As Range, row As Range
Dim i As Long, j As Long
Dim aryStyle As Variant

Application.Volatile
If rng.Areas.Count 1 Then
TextStyle = CVErr(xlErrValue)
Exit Function
End If

If rng.Cells.Count = 1 Then
Select Case iStyle
Case 1:
aryStyle = (rng.Font.Underline < xlUnderlineStyleNone)
Case 2:
aryStyle = rng.Font.Bold
Case 3:
aryStyle = rng.Font.Italic
End Select

Else
aryStyle = rng.Value
i = 0

For Each row In rng.Rows
i = i + 1
j = 0

For Each cell In row.Cells
j = j + 1
Select Case iStyle
Case 1:
aryStyle(i, j) = CBool(cell.Font.Underline <
xlUnderlineStyleNone)
Case 2:
aryStyle(i, j) = CBool(cell.Font.Bold = True)
Case 3:
aryStyle(i, j) = CBool(cell.Font.Italic)
End Select
Next cell
Next row
End If

TextStyle = aryStyle

End Function

--

HTH

RP
(remove nothere from the email address if mailing direct)


"Josh - Westfield Australia" <Josh - Westfield
wrote in message
...
Is there a way to count cells in a column which have been highlighted or

text
that has been italicised??. As i have a column full of dates, and when
something is completed the suggested date is changed to the actual date,
highlighted and italicised. I need to keep a count on the completed dates.



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 empty cells within a range of cells Rosehill - ExcelForums.com New Users to Excel 2 May 2nd 05 08:53 AM
Counting empty cells within a range of cells Rosehill - ExcelForums.com New Users to Excel 0 April 7th 05 12:47 AM
counting cells with conditional formatting applied HalB Excel Discussion (Misc queries) 3 February 21st 05 01:21 PM
counting text cells Debbie Excel Worksheet Functions 4 February 8th 05 09:00 PM
Counting nonblank and non white space cells Andrew Excel Worksheet Functions 6 February 8th 05 04:33 AM


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