Bonjour,
Vite fait... Essaie comme ceci, le code est un peu lent toutefois (vu les boucles)
Sub tes()
'Macro Dan pour jeremy
Dim i As Integer, j As Integer
Range(Cells(5, 4), Cells(41, 4)).FormulaR1C1 = "=if(RC[-1]="""","""",2)"
For i = 8 To 48 Step 4
For j = 5 To 41
If Cells(j, 4) <> 5 Then Cells(j, i).FormulaR1C1 = "=if(RC[-1]="""","""",2)"
Next
Next i
End Sub
Il serait intéressant de dire quelle est la condition pour avoir le chiffre 5 dans la colonne D
Amicalement