View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
bluevortex[_2_] bluevortex[_2_] is offline
external usenet poster
 
Posts: 1
Default Selection based on coloured cells?

Thank you for the quick response Jim!

I presume I have to start using next function ?


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 OfText = True Then
CountByColor = CountByColor - _
(Rng.Font.ColorIndex = WhatColorIndex)
Else
CountByColor = CountByColor - _
(Rng.Interior.ColorIndex = WhatColorIndex)
End If
Next Rng

End Function


But then? What's next ? How can I get excel automatically make a
overview based on those colored cells?
As stated before; vba is not my kind of thing...

Anyone?:confused

--
Message posted from http://www.ExcelForum.com