Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I would really really appreciate it if someone could take a look at this and
asee if there is a way of making the VBA quickwer, at the moment this runs like a dog!! ------------------------------------------------------- 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 -------------------------------------------------------------------- Thank you very much everone. I do appreciate your help. Merry Xmas |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Tidying up workbook (and pivot table help)... | Excel Discussion (Misc queries) | |||
Need help tidying up a report | Excel Discussion (Misc queries) | |||
Help Tidying up formula | Excel Worksheet Functions |