Sum same Color's cell contain number in Ms Excel.

By Md.shaiful islam Talukder | 9:50 PM | | |
Sum same color's cell.
Sum same Color's cell contain number in Ms Excel.Several time we face color cell sum ,so I include here first Vb function than this function use for sum . Find details . Enjoy it!
Function ColorFunction(rColor As Range, rRange As Range, Optional SUM As Boolean)
Dim rCell As Range
Dim lCol As Long
Dim vResult
lCol = rColor.Interior.ColorIndex
    If SUM = True Then
       For Each rCell In rRange
        If rCell.Interior.ColorIndex = lCol Then
                vResult = WorksheetFunction.SUM(rCell) + vResult
        End If
       Next rCell
    Else
        For Each rCell In rRange
        If rCell.Interior.ColorIndex = lCol Then
                vResult = 1 + vResult
        End If
       Next rCell
End If
ColorFunction = vResult
End Function
'------------------Md.Shaiful Islam Talukder --------------------

2 comments :

  1. It is very rare these days to find blogs that provide information someone is looking for. I am glad to see that your blog share valued information that can help to many readers. Thanks and keep writing!
    www.fadeplex.com

    ReplyDelete

Top^