+ Reply to Thread
Results 1 to 5 of 5

Count colourindex - VBA

Hybrid View

  1. #1
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: Count colourindex - VBA

    Maybe:

    Sub wrightyrx7()
    Dim Sick, Sickness As Worksheet
    Dim g, r, a As Long
    Dim i As Long
    
    Set Sick = Sheets("Sick")
    Set Sickness = Sheets("Sickness (Confidential)")
    
        g = 0
        r = 0
        a = 0
    Sickness.Activate
    For i = Range("M" & Rows.count).End(3)(1).Row To 7 Step -1
            If Range("M" & i).Interior.ColorIndex = 4 Then g = g + 1
            If Range("M" & i).Interior.ColorIndex = 3 Then r = r + 1
            If Range("M" & i).Interior.ColorIndex = 45 Then a = a + 1
    Next i
    
    Sick.Range("B5").Value = g
    Sick.Range("B6").Value = a
    Sick.Range("B7").Value = r
    End Sub
    Last edited by JOHN H. DAVIS; 02-27-2014 at 07:52 AM.

+ 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. Replies: 3
    Last Post: 11-18-2013, 02:06 AM
  2. [SOLVED] for every line I browse make a count and post this count in a cell (fiouuu)
    By historic777 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-30-2013, 06:41 AM
  3. Range.columns.count property returns wrong count after union operation
    By gopinan in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-13-2008, 04:48 AM
  4. [SOLVED] Count Intervals of Filtered TEXT values in Column and Return Count across a Row
    By Sam via OfficeKB.com in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 12:05 PM
  5. [SOLVED] Count Intervals of Filtered TEXT values in Column and Return Count across a Row
    By Domenic in forum Excel Formulas & Functions
    Replies: 27
    Last Post: 09-06-2005, 04:05 AM

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