Sheets("Formations pour 1 Stagiaire").Cells(i, j + 16).FormulaArray = _ "=IF(ISNA(VLOOKUP(RC[-15],OFFSET(Mod_Spé,MATCH(RC[2],PPP_Spé,0)-1,0,MATCH(RC[2],PPP_Spé,1)-MATCH(RC[2],PPP_Spé,0)+1,3),3,FALSE)),INDEX(Mod_Trans,IF(RC[3]=""Date 2"", MATCH(RC[2]&RC[-15],PPP_Trans&Mod_Trans_Lib,0)+1,IF(RC[3]=""Date 3"",MATCH(RC[2]&RC[-15], PPP_Trans&Mod_Trans_Lib ,0)+2)),3),VLOOKUP(RC[-15],OFFSET(Mod_Spé,MATCH(RC[2],PPP_Spé,1)-MATCH(RC[2],PPP_Spé,0)+1),3,FALSE))"
Dim theFormula Dim FormulaTrue Dim RechercheV RechercheV = "=VLOOKUP(RC[-15],OFFSET(Msa,MATCH(RC[2],Ps,0)-1,0," & _ "MATCH(RC[2],Ps,1)- MATCH(RC[2],Ps,0)+1,3),3,FALSE)" theFormula = "=ISNA(" & RechercheV & ")" FormulaTrue = "=INDEX(Mta,IF(RC[3]="" Date 2 "",MATCH(RC[2]&RC[-15],Pt&Mt,0)+1" & _ ",IF(RC[3]=""Date 3"",MATCH(RC[2]&RC[-15], Pt&Mt ,0)+2)),3)" If theFormula = True Then Sheets("Formations pour 1 Stagiaire").Cells(i, j + 16).Formula = FormulaTrue ElseIf theFormula = False Then Sheets("Formations pour 1 Stagiaire").Cells(i, j + 16).Formula = RechercheV End If
Vous n’avez pas trouvé la réponse que vous recherchez ?
Posez votre questionIf txtEffectif.Value > 1 Then Sheets("Formations pour 1 Stagiaire").Range("R3").AutoFill _ Destination:=Sheets("Formations pour 1 Stagiaire").Range("R3:R" & i & ""), Type:=xlFillDefault End If 'Compteur effectif txtEffectif.Value = c