Ask Me Help Desk

Ask Me Help Desk (https://www.askmehelpdesk.com/forum.php)
-   Spreadsheets (https://www.askmehelpdesk.com/forumdisplay.php?f=395)
-   -   How to count the cells in excel with different fill pattern styles (https://www.askmehelpdesk.com/showthread.php?t=223773)

  • Jun 6, 2008, 12:38 AM
    sriku24
    How to count the cells in excel with different fill pattern styles
    Hi

    I want to count the cells in excel with different fill pattern styles.

    How is it possible. Can anyone post the function for this purpose like counting coloured cells.

    I tried a lot , but I got failed.

    Here I got a function to count cells filled solid, but it is not working... is it correct??

    Function CountCellpattern(CellPat As Range, rSumRange As Range)

    Dim rCell As Range
    Dim iPat As Integer
    Dim vResult

    iPat = CellPat.Interior.Pattern

    For Each rCell In rSumRange

    If iPat = 1 Then

    vResult = vResult + 1
    End If
    Next rCell

    CountCellpattern = vResult

    End Function
  • Jun 6, 2008, 01:34 AM
    Clough
    I don't know if this is exactly what you are looking for, but the following site seems to have some good information concerning the counting of cells. I hope that it is helpful to you!

    http://www.contextures.com/xlFunctions04.html
  • Jun 6, 2008, 06:55 AM
    ScottGem
    What's not working? Have you tried stepping through the function?

  • All times are GMT -7. The time now is 01:03 PM.