+ Reply to Thread
Results 1 to 4 of 4

Count number of cells in a range that have a yellow fill

  1. #1
    Registered User
    Join Date
    09-13-2012
    Location
    Atlanta, Georgia
    MS-Off Ver
    Excel 2010
    Posts
    32

    Count number of cells in a range that have a yellow fill

    Hello, I have always wondered if there was a to perform operations based on a cells format without using macros. What I would like to do is count the number of cells in a range formatted yellow.

  2. #2
    Forum Expert mrice's Avatar
    Join Date
    06-22-2004
    Location
    Surrey, England
    MS-Off Ver
    Excel 2013
    Posts
    4,967

    Re: Count number of cells in a range that have a yellow fill

    You could do this with a user defined function but would this count as a macro?
    Martin

  3. #3
    Registered User
    Join Date
    09-13-2012
    Location
    Atlanta, Georgia
    MS-Off Ver
    Excel 2010
    Posts
    32

    Re: Count number of cells in a range that have a yellow fill

    Hmmm I suppose not in this case. I've never set up a user defined function before. How would I do this?

  4. #4
    Forum Expert mrice's Avatar
    Join Date
    06-22-2004
    Location
    Surrey, England
    MS-Off Ver
    Excel 2013
    Posts
    4,967

    Re: Count number of cells in a range that have a yellow fill

    Try this

    Please Login or Register  to view this content.
    Open the VBA editor by hitting Alt F11.
    Insert a new module with Insert - Module
    Paste in the above function
    Go back to the sheet by hitting Alt F11.

    In a suitable cell, enter = =CountYellow(A1:H19) etc.

    Remember to save the workbook as a macro enabled workbook .xlsm

    Note that as formatting a cell does not trigger the calculation to happen, you will not see dynamic behaviour if you just add or remove yellow formatting.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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