Hello,
I Can't find the right syntax to type a sumproduct formula in VBA.
After searching I've come tot he fact that I can't use the SumProduct function without evaluating it but the code line is filled with """ that I can't make any sense of.
What I am trying to achieve is replace the CountIF line in this code with a Sumproduct function:
Dim MyColumn As Long, r As Long, lngLastRow As Long
MyColumn = ActiveCell.Column
With Sheets("Project Breakdown")
lngLastRow = .Cells(.Rows.Count, MyColumn).End(xlUp).Row
For r = lngLastRow To 1 Step -1
If InStr(1, Cells(r, MyColumn - 2), "DIV", vbTextCompare) = 0 And InStr(1, Cells(r, MyColumn - 2), "SEC", vbTextCompare) = 0 Then
If WorksheetFunction.CountIf(.Columns(MyColumn), .Cells(r, MyColumn).Value) > 1 Then
.Cells(r, MyColumn).Select
ActiveCell.Rows("1:1").EntireRow.Select
Selection.Delete Shift:=xlUp
End If
End If
Next r
End With
Could someone please help!