+ Reply to Thread
Results 1 to 4 of 4

Count no of rows with interior color

Hybrid View

  1. #1
    sheeba
    Guest

    Count no of rows with interior color

    Hello!


    Is it possible to count the nuber of rows in a range with interior
    color (any)

    for eg. on range "B1:F20" if any cell in B1:F1 got interior color count
    it and check next row B2:F2 ... like wise and count the number of rows
    in the range having atleast one cell with interior color.

    thanks


  2. #2
    Gary Keramidas
    Guest

    Re: Count no of rows with interior color

    here's one way. it will count the number filled with blue (37) in column a

    Option Explicit
    Dim cell As Range
    Dim lastrow As Long
    Dim wks1 As Worksheet
    Dim i As Integer
    Sub count_colors()
    lastrow = Worksheets("sheet1").Cells(Rows.Count, "A").End(xlUp).Row
    Set wks1 = Worksheets("Sheet1")

    Dim counter As Integer
    For i = lastrow To 1 Step -1
    Debug.Print lastrow
    If Cells(i, 1).Interior.ColorIndex = 37 Then
    counter = counter + 1
    End If
    Next i
    MsgBox counter
    Debug.Print i
    End Sub

    --


    Gary


    "sheeba" <sheeba.abdulsalam@gmail.com> wrote in message
    news:1134195638.321431.175650@g47g2000cwa.googlegroups.com...
    > Hello!
    >
    >
    > Is it possible to count the nuber of rows in a range with interior
    > color (any)
    >
    > for eg. on range "B1:F20" if any cell in B1:F1 got interior color count
    > it and check next row B2:F2 ... like wise and count the number of rows
    > in the range having atleast one cell with interior color.
    >
    > thanks
    >




  3. #3
    Norman Jones
    Guest

    Re: Count no of rows with interior color

    Hi Sheeba,

    See Chip Pearsons colour functions page at:

    http://www.cpearson.com/excel/colors.htm


    ---
    Regards,
    Norman


    "sheeba" <sheeba.abdulsalam@gmail.com> wrote in message
    news:1134195638.321431.175650@g47g2000cwa.googlegroups.com...
    > Hello!
    >
    >
    > Is it possible to count the nuber of rows in a range with interior
    > color (any)
    >
    > for eg. on range "B1:F20" if any cell in B1:F1 got interior color count
    > it and check next row B2:F2 ... like wise and count the number of rows
    > in the range having atleast one cell with interior color.
    >
    > thanks
    >




  4. #4
    Bob Phillips
    Guest

    Re: Count no of rows with interior color

    or http://www.xldynamic.com/source/xld.ColourCounter.html

    --

    HTH

    RP
    (remove nothere from the email address if mailing direct)


    "Norman Jones" <normanjones@whereforartthou.com> wrote in message
    news:e5tR5fW$FHA.328@TK2MSFTNGP14.phx.gbl...
    > Hi Sheeba,
    >
    > See Chip Pearsons colour functions page at:
    >
    > http://www.cpearson.com/excel/colors.htm
    >
    >
    > ---
    > Regards,
    > Norman
    >
    >
    > "sheeba" <sheeba.abdulsalam@gmail.com> wrote in message
    > news:1134195638.321431.175650@g47g2000cwa.googlegroups.com...
    > > Hello!
    > >
    > >
    > > Is it possible to count the nuber of rows in a range with interior
    > > color (any)
    > >
    > > for eg. on range "B1:F20" if any cell in B1:F1 got interior color count
    > > it and check next row B2:F2 ... like wise and count the number of rows
    > > in the range having atleast one cell with interior color.
    > >
    > > thanks
    > >

    >
    >




+ 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