Code:
Sub Try1()
'
Dim NextRow As Long:
Dim f1 As String
With ThisWorkbook.Worksheets("try"): NextRow = .Range("A" & .Rows.Count).End(xlUp).Row:
‘
f1 = Evaluate("=countif(“D" & NextRow -2 & ":" & "D" & NextRow & "," & "D" & NextRow)")
Range("F" & NextRow).Value = f1
End With
End Sub
Please!