Results 1 to 4 of 4

Sumif - Colorindex = 37

Threaded View

  1. #1
    Forum Expert NeedForExcel's Avatar
    Join Date
    03-16-2013
    Location
    Pune, India
    MS-Off Ver
    Excel 2016:2019, MS 365
    Posts
    3,879

    Sumif - Colorindex = 37

    I have some data where I have colored certain Values.

    I want to write a code that would Sum only if the Color Index is 37.

    I have attached the sheet as well as the code.

    Can anyone clarify what is wrong?

    Code =


    Sub Colorindex()
    
    
    Dim LR As Integer, Counter As Byte, GT As Double
    
    ThisWorkbook.Sheets("Sheet1").Activate
    
    LR = Sheets("Sheet1").Cells(Rows.Count, 1).End(xlUp).Row
    
    For Counter = 1 To LR
     
    GT = Application.WorksheetFunction.SumIf(Range("A1:A" & LR), Range("A" & Counter).Interior.Colorindex = 37, (Range("A1:A" & LR)))
    
    
    Next Counter
    
    End Sub
    Attached Files Attached Files
    Cheers!
    Deep Dave

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