Results 1 to 2 of 2

Convert CountIFs into SumProduct

Threaded View

  1. #1
    Registered User
    Join Date
    07-17-2012
    Location
    Malaysia
    MS-Off Ver
    Excel 2007
    Posts
    48

    Lightbulb Convert CountIFs into SumProduct

    Hi All,


    I'm newbie on the vba programming and found out excel 2003 didnt support CountIFs.
    Could any one help me to convert this vba into sumproduct or countif ?

    If WorksheetFunction.CountIfs(Sheets("Sheet1").Range("A1:A" & lastrow), Cells(i, 2), Sheets("Sheet1").Range("C1:C" & lastrow), Cells(i, 9)) = 1 Then
          Cells(i, 1).Resize(1, 12).Copy Destination:=OutSH.Cells(Rows.Count, 1).End(xlUp).Offset(1, 0)
    End If
    
    If WorksheetFunction.CountIfs(Sheets("Sheet1").Range("A1:A" & lastrow), Cells(i, 2), Sheets("Sheet1").Range("C1:C" & lastrow), Cells(i, 9)) = 0 Then
          Cells(i, 1).Resize(1, 12).Copy Destination:=OutSH.Cells(Rows.Count, 1).End(xlUp).Offset(1, 0)
    End If
    Last edited by Cutter; 07-19-2012 at 09:25 PM. Reason: Added code tags

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