Code:
For Each cl2 In Table2
nom1 = Sheets("Date_Step").Cells(Step2_Row, Step2_Clm).Value
nom2 = Application.WorksheetFunction.VLookup(nom1, Table11, 2)
nom3 = Sheets("Date_Step").Cells(nom_Row, Nom_Clm).Value
Total = Application.WorksheetFunction.CountIfs(Table10, nom2, Table12, nom3)
cl2.FormulaArray = _
"=INDEX(Log_WK!C[-7],MATCH(Date_Step!RC[-6],IF(VLOOKUP(RC[-1], Correspondance!R[" & i & "]C[-7]:R[" & j & "]C[-6], 2, FALSE)=Log_WK!C[-5],Log_WK!C[-4]),0)" & [B]Total[/B] & " [B]-1[/B])"
If Not IsError(cl2) Then
Result = cl2
Else
Result = ""
End If
Sheets("Date_Step").Cells(Date2_Row, Date2_Clm) = Result
nom_Row = nom_Row + 1
Date2_Row = Date2_Row + 1
Step2_Row = Step2_Row + 1
i = i - 1
j = j - 1
Next cl2
With the array formula I tried to find the last value.
I had look an internet and I found a page telling me to add Total-1 (in bold type) but it does not work.
Do you have an idea on how I can do it?