1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106
| If range("AR4" & "AS4").value = "" GoTo line1
'gjn
Range("AU4").Value = Range("AR4").Value - Range("D4").Value
'vbn
Range("AV4").Value = Range("AS4").Value - Range("E4").Value
For U = 9 To 40
Cells(U, 9) = Cells(U, 9) + Range("AU4").Value
Cells(U, 13) = Cells(U, 13) + Range("AU4").Value
Cells(U, 17) = Cells(U, 17) + Range("AU4").Value
Cells(U, 10) = Cells(U, 10) + Range("AV4").Value
Cells(U, 14) = Cells(U, 14) + Range("AV4").Value
Cells(U, 18) = Cells(U, 18) + Range("AV4").Value
Next U
Range("D4").Value = Range("AR4").Value
Range("E4").Value = Range("AS4").Value
'REMA
For h = 9 To 40
If Cells(h, 24) = "N/A" Then
Else
Cells(h, 24) = Cells(h, 24) - Feuil5.Range("AU4").Value
End If
Next h
'REM
For E = 9 To 40
If Cells(E, 24) = "N/A" Then
Else
Cells(E, 24) = Cells(E, 24) - Feuil5.Range("AV4").Value
End If
Next E
' PRIX
For t = 9 To 40
Cells(t, 44) = Cells(t, 10)
Next t
Range("AU4").Value = ""
Range("AV4").Value = ""
Range("AR4").Value = ""
Range("AS4").Value = ""
line1 :
'WFG
Feuil14.Range("O2:U2").ClearContents
Feuil5.Range("G4:Z4").ClearContents
Dim Compid As Range
Set Compid = Feuil14.Range("A:A").Find(what:=Range("B4").Value, LookIn:=xlValues, lookat:=xlWhole)
Feuil14.Range("O2").Value = Compid.Offset(, 1).Value
Feuil14.Range("P2").Value = Compid.Offset(, 2).Value
Feuil14.Range("Q2").Value = Compid.Offset(, 3).Value
Feuil14.Range("R2").Value = Compid.Offset(, 10).Value
Feuil14.Range("S2").Value = Compid.Offset(, 11).Value
Feuil14.Range("T2").Value = Compid.Offset(, 12).Value
Feuil14.Range("U2").Value = Compid.Offset(, 9).Value
Feuil5.Range("G4").Value = Feuil14.Range("O2")
Feuil5.Range("H4").Value = Feuil14.Range("U2")
'LES
Feuil14.Range("N2:N15").ClearContents
Feuil5.Range("Z9:Z40").AdvancedFilter xlFilterCopy, CopyToRange:=Feuil14.Range("N2:N15"), Unique:=True
Feuil5.Range("I4") = Feuil14.Range("N2").Value
Feuil5.Range("K4") = Feuil14.Range("N3").Value
Feuil5.Range("M4") = Feuil14.Range("N4").Value
Feuil5.Range("O4") = Feuil14.Range("N5").Value
Feuil5.Range("Q4") = Feuil14.Range("N6").Value
Feuil5.Range("S4") = Feuil14.Range("N7").Value
Feuil5.Range("U4") = Feuil14.Range("N8").Value
Feuil5.Range("W4") = Feuil14.Range("N9").Value
Feuil5.Range("Y4") = Feuil14.Range("N10").Value
'Remplacer l
Set Compid = Feuil14.Range("B:B").Find(what:=Range("I4").Value, LookIn:=xlValues, lookat:=xlWhole)
Range("J4").Value = Compid.Offset(, 8).Value
Set Compid = Feuil14.Range("B:B").Find(what:=Range("K4").Value, LookIn:=xlValues, lookat:=xlWhole)
Range("L4").Value = Compid.Offset(, 8).Value
Set Compid = Feuil14.Range("B:B").Find(what:=Range("M4").Value, LookIn:=xlValues, lookat:=xlWhole)
Range("N4").Value = Compid.Offset(, 8).Value
Set Compid = Feuil14.Range("B:B").Find(what:=Range("O4").Value, LookIn:=xlValues, lookat:=xlWhole)
Range("P4").Value = Compid.Offset(, 8).Value
Set Compid = Feuil14.Range("B:B").Find(what:=Range("Q4").Value, LookIn:=xlValues, lookat:=xlWhole)
Range("R4").Value = Compid.Offset(, 8).Value
Set Compid = Feuil14.Range("B:B").Find(what:=Range("S4").Value, LookIn:=xlValues, lookat:=xlWhole)
Range("T4").Value = Compid.Offset(, 8).Value
Set Compid = Feuil14.Range("B:B").Find(what:=Range("U4").Value, LookIn:=xlValues, lookat:=xlWhole)
Range("V4").Value = Compid.Offset(, 8).Value
Set Compid = Feuil14.Range("B:B").Find(what:=Range("W4").Value, LookIn:=xlValues, lookat:=xlWhole)
Range("X4").Value = Compid.Offset(, 8).Value
Set Compid = Feuil14.Range("B:B").Find(what:=Range("Y4").Value, LookIn:=xlValues, lookat:=xlWhole)
Range("Z4").Value = Compid.Offset(, 8).Value
End Sub |
Partager