+ Reply to Thread
Results 1 to 2 of 2

Count where cells are yellow in one column and a specific name in another.

  1. #1
    Registered User
    Join Date
    06-21-2013
    Location
    Warren, OH
    MS-Off Ver
    Excel 2016
    Posts
    3

    Count where cells are yellow in one column and a specific name in another.

    So, I have this:

    HTML Code: 
    Public Function CountBlackCells(rng As Range) As Long
        'Variable declaration
        Dim lColorCounter As Long
        Dim rngCell As Range
        'loop throught each cell in the range
        For Each rngCell In rng
            'Checking Yellor color
            If Cells(rngCell.Row, rngCell.Column).Interior.Color = RGB(0, 0, 0) Then
                lColorCounter = lColorCounter + 1
            End If
        Next
        'Return the value
        CountBlackCells = lColorCounter
    End Function
    and it works great, although slow. I need to also count if say Todd has any yellow in column A and so on. Any ideas?

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2003,2007,2010
    Posts
    32,486

    Re: Count where cells are yellow in one column and a specific name in another.

    Maybe:

    Please Login or Register  to view this content.
    Trevor Shuttleworth - Excel Aid

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Can I count cells with specific format (e.g., yellow field?)
    By umaanddottie in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 09-06-2005, 03:05 AM
  2. [SOLVED] Can I count cells with specific format (e.g., yellow field?)
    By umaanddottie in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 09-06-2005, 02:05 AM
  3. [SOLVED] Can I count cells with specific format (e.g., yellow field?)
    By umaanddottie in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 09-06-2005, 01:05 AM
  4. Can I count cells with specific format (e.g., yellow field?)
    By umaanddottie in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 09-06-2005, 12:05 AM
  5. [SOLVED] Can I count cells with specific format (e.g., yellow field?)
    By umaanddottie in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 09-05-2005, 11:05 PM
  6. Can I count cells with specific format (e.g., yellow field?)
    By umaanddottie in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 09-05-2005, 10:05 PM
  7. Can I count cells with specific format (e.g., yellow field?)
    By umaanddottie in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 05-30-2005, 07:05 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1