conditinal SUM formula RRS feed

  • Question

  • I need to have a forum;a that will give me something like

    sheet1.(row3,cell5) = sum(sheet2.columB) if sheet2.columnD = OK

    Can anyone provide this formula - it would be greatly appreciated, many thanks in advance

    Monday, September 29, 2014 3:05 PM


  • Sub TestMacro()
        With Worksheets("Sheet1").Cells(3, 5)
            .Formula = "=SUMIF(Sheet2!D:D,""OK"",Sheet2!B:B)"
            '.Value = .Value  'optional code to convert formula to value
        End With
    End Sub

    Monday, September 29, 2014 4:28 PM