Results 1 to 5 of 5

Thread: counting red cells
Thanks Thanks: 0 Likes Likes: 0

  1. #1
    Board Regular
    Join Date
    Jul 2005
    Location
    34
    Posts
    152
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default counting red cells

    i have a large range of data but some of the cells are red i want a cell at the bottom olf the data to calculate the number of red cells in the sheet.
    ererererer

  2. #2
    Board Regular chicagodiceman's Avatar
    Join Date
    Mar 2004
    Posts
    371
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Welcome To The board

    I'm sure that one of the true Gurus on this board will be able to come up with a more eloquent way of doing this but...

    If your data isn't too large, you could use a macro to store a count of cells formatted with red text something like this. It assumes your data begins in a1 and there are no blank cells in your data range:

    Code:
    Dim Count_Red As Integer
    Sub findred()
    Count_Red = 0
    Range("a1").Select
    Do Until ActiveCell.Value = ""
    If ActiveCell.Font.Color = vbRed Then
    Count_Red = Count_Red + 1
    End If
    ActiveCell.Offset(1, 0).Select
    Loop
    ActiveCell.Value = Count_Red
    End Sub
    No trees were harmed in the generation of this message.
    A significant number of electrons were, however, severely inconvenienced.

  3. #3
    Board Regular apolloh's Avatar
    Join Date
    Jul 2005
    Location
    Amoy, China
    Posts
    103
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Best regards,
    Apollo Huang

    Microsoft MVP
    www.exceltip.net

  4. #4
    MrExcel MVP Richie(UK)'s Avatar
    Join Date
    May 2002
    Location
    UK
    Posts
    3,329
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Hi Chris,

    Chip Pearson has some useful routines for working with colour. Have a look here.

    HTH
    Richie

  5. #5
    Board Regular chicagodiceman's Avatar
    Join Date
    Mar 2004
    Posts
    371
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    And now I've learned something else. This board is great. Thanks Richie
    No trees were harmed in the generation of this message.
    A significant number of electrons were, however, severely inconvenienced.

Some videos you may like

User Tag List

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

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