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 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526
| Option Explicit 'indique les variables non déclarées
Sub combinaison()
Dim N21 As Integer, N41 As Integer, N31 As Integer, N22 As Integer, N42 As Integer, N32 As Integer, N23 As Integer, N43 As Integer, N33 As Integer, N24 As Integer, N44 As Integer, N34 As Integer, z21 As Integer, z41 As Integer, z31 As Integer, z22 As Integer, z42 As Integer, z32 As Integer, z23 As Integer, z43 As Integer, z33 As Integer, z24 As Integer, z44 As Integer, z34 As Integer, w21 As Integer, w41 As Integer, w31 As Integer, w22 As Integer, w42 As Integer, w32 As Integer, w23 As Integer, w43 As Integer, w33 As Integer, w24 As Integer, w44 As Integer, w34 As Integer, W As Integer, A As Integer, Aa As Integer, Ab As Integer, Ba As Integer, Bb As Integer, B As Integer
Dim T21 As Single, s21 As Single, T41 As Single, s41 As Single, T31 As Single, s31 As Single, T22 As Single, s22 As Single, T42 As Single, s42 As Single, T32 As Single, s32 As Single, T23 As Single, s23 As Single, T43 As Single, s43 As Single, T33 As Single, s33 As Single, T24 As Single, s24 As Single, T44 As Single, s44 As Single, T34 As Single, s34 As Single
Dim X21 As Integer, X41 As Integer, X31 As Integer, X22 As Integer, X42 As Integer, X32 As Integer, X23 As Integer, X43 As Integer, X33 As Integer, X24 As Integer, X44 As Integer, X34 As Integer, Xtot1 As Integer, Xtot2 As Integer, Xtot3 As Integer, Xtot4 As Integer
Dim maxi As Integer, Maxi21SF As Integer, Maxi41DF As Integer, Maxi31SF As Integer, Maxi22SF As Integer, Maxi42DF As Integer, Maxi32SF As Integer, Maxi23SF As Integer, Maxi43DF As Integer, Maxi33SF, Maxi24SF As Integer, Maxi44DF As Integer, Maxi34SF, MaxiT21 As Single, MaxiT22 As Single, MaxiT23 As Single, MaxiT24 As Single, TapresT21 As Single, TapresT41 As Single, TapresT31 As Single, TapresT22 As Single, TapresT42 As Single, TapresT32 As Single, TapresT23 As Single, TapresT43 As Single, TapresT33 As Single, TapresT24 As Single, TapresT44 As Single, TapresT34 As Single, TSFDF21 As Integer, TSFDF31 As Integer, TSFDF22 As Integer, TSFDF32 As Integer, TSFDF23 As Integer, TSFDF33 As Integer, TSFDF24 As Integer, TSFDF34 As Integer, TSFSF2131 As Integer, TSFSF2232 As Integer, TSFSF2333 As Integer, TSFSF2434 As Integer
Dim Ligne As Long, PT As Integer
Dim a21 As Integer, a41 As Integer, a31 As Integer, a22 As Integer, a42 As Integer, a32 As Integer, a23 As Integer, a43 As Integer, a33 As Integer, a24 As Integer, a44 As Integer, a34 As Integer
Dim DicoAntiDoublon As New Dictionary, StrAntiDoublon As String
'On stop le refraichissement pour eviter le scintillement et gagner en vitesse
Application.ScreenUpdating = False
[A7.BF65536].ClearContents
[S1].ClearContents
[S2].ClearContents
[S3].ClearContents
[S4].ClearContents
[U1].ClearContents
[U2].ClearContents
[U3].ClearContents
[U4].ClearContents
[W1].ClearContents
[W2].ClearContents
[W3].ClearContents
[W4].ClearContents
W = [A3] 'nb max camion/jour
Ab = [C3] 'rdt/jour déblais
Aa = [C1] 'rdt limite/jour déblais
Ba = [E1] 'rdt limite/jour remblais
Bb = [E3] 'rdt/jour remblais
T21 = [G1]
T41 = [G3]
T31 = [G5]
T22 = [J1]
T42 = [J3]
T32 = [J5]
T23 = [M1]
T43 = [M3]
T33 = [M5]
T24 = [P1]
T44 = [P3]
T34 = [P5]
maxi = [A5] 'nb heures travaillées max
Ligne = 7
Maxi21SF = Int(maxi / T21) 'nb maxi de tours/camions/jour en SF déblais(6m3)
Maxi41DF = Int(maxi / T41) 'nb maxi de tours/camion/jour en DF (6)
Maxi31SF = Int(maxi / T31) 'nb maxi de tours/camions/jour en SF remblais(6m3)
Maxi22SF = Int(maxi / T22) 'nb maxi de tours/camions/jour en SF déblais(8m3)
Maxi42DF = Int(maxi / T42) 'nb maxi de tours/camion/jour en DF (8)
Maxi32SF = Int(maxi / T32) 'nb maxi de tours/camions/jour en SF remblais(8m3)
Maxi23SF = Int(maxi / T23) 'nb max de tour/cam/j en SF déblais(10M3)
Maxi43DF = Int(maxi / T43) 'nb max de tour/cam/j en DF(10)
Maxi33SF = Int(maxi / T33) 'nb max de tour/cam/j en SF remblais(10M3)
Maxi24SF = Int(maxi / T24) 'nb maxi de tours/camions/jour en SF déblais(12m3)
Maxi44DF = Int(maxi / T44) 'nb maxi de tours/camion/jour en DF (12)
Maxi34SF = Int(maxi / T34) 'nb maxi de tours/camions/jour en SF remblais(12m3)
'Il vaut mieux mettre ca ici plutot que de le repeter a chaque boucle
[S1] = Maxi21SF
[U1] = Maxi41DF
[W1] = Maxi31SF
[S2] = Maxi22SF
[U2] = Maxi42DF
[W2] = Maxi32SF
[S3] = Maxi23SF
[U3] = Maxi43DF
[W3] = Maxi33SF
[S4] = Maxi24SF
[U4] = Maxi44DF
[W4] = Maxi34SF
For w21 = 0 To W
For z21 = 1 To Maxi21SF
For w41 = 0 To W - w21
For z41 = 1 To Maxi41DF
For w31 = 0 To W - (w21 + w41)
For z31 = 1 To Maxi31SF
For w22 = 0 To W - (w21 + w41 + w31)
For z22 = 1 To Maxi22SF
For w42 = 0 To W - (w21 + w41 + w31 + w22)
For z42 = 1 To Maxi42DF
For w32 = 0 To W - (w21 + w41 + w31 + w22 + w42)
For z32 = 1 To Maxi32SF
For w23 = 0 To W - (w21 + w41 + w31 + w22 + w42 + w32)
For z23 = 1 To Maxi23SF
For w43 = 0 To W - (w21 + w41 + w31 + w22 + w42 + w32 + w23)
For z43 = 1 To Maxi43DF
For w33 = 0 To W - (w21 + w41 + w31 + w22 + w42 + w32 + w23 + w43)
For z33 = 1 To Maxi33SF
For w24 = 0 To W - (w21 + w41 + w31 + w22 + w42 + w32 + w23 + w43 + w33)
For z24 = 1 To Maxi24SF
For w44 = 0 To W - (w21 + w41 + w31 + w22 + w42 + w32 + w23 + w43 + w33 + w24)
For z44 = 1 To Maxi44DF
For w34 = 0 To W - (w21 + w41 + w31 + w22 + w42 + w32 + w23 + w43 + w33 + w24 + w44)
For z34 = 1 To Maxi34SF
A = z21 * w21 * 6 + z41 * w41 * 6 + z22 * w22 * 8 + z42 * w42 * 8 + z23 * w23 * 10 + z43 * w43 * 10 + z24 * w24 * 12 + z44 * w44 * 12
B = z31 * w31 * 6 + z41 * w41 * 6 + z32 * w32 * 8 + z42 * w42 * 8 + z33 * w33 * 10 + z43 * w43 * 10 + z34 * w34 * 12 + z44 * w44 * 12
If (Aa < A And A <= Ab) And (Ba < B And B <= Bb) Then
N21 = z21 * w21
N41 = z41 * w41
N31 = z31 * w31
N22 = z22 * w22
N42 = z42 * w42
N32 = z32 * w32
N23 = z23 * w23
N43 = z43 * w43
N33 = z33 * w33
N24 = z24 * w24
N44 = z44 * w44
N34 = z34 * w34
s21 = N21 * T21
s41 = N41 * T41
s31 = N31 * T31
s22 = N22 * T22
s42 = N42 * T42
s32 = N32 * T32
s23 = N23 * T23
s43 = N43 * T43
s33 = N33 * T33
s24 = N24 * T24
s44 = N44 * T44
s34 = N34 * T34
'initialisation des valeurs de X
X21 = 0
X41 = 0
X31 = 0
X22 = 0
X42 = 0
X32 = 0
X23 = 0
X43 = 0
X33 = 0
X24 = 0
X44 = 0
X34 = 0
'intialisation des temps restants
TapresT21 = 0
TapresT41 = 0
TapresT31 = 0
TapresT22 = 0
TapresT42 = 0
TapresT32 = 0
TapresT23 = 0
TapresT43 = 0
TapresT33 = 0
TapresT24 = 0
TapresT44 = 0
TapresT34 = 0
'a) si N21=N41=N31=0, on va à la ligne suivante
If Not (N21 = 0 And N41 = 0 And N31 = 0) Then
'on détermine le nombre de camions qu'il faut pour le simple fret
'on cherche X21 tq Maxi*(X21-1)<=s21<=Maxi*X21
If Int(N21 / Maxi21SF) < N21 / Maxi21SF Then X21 = Int(N21 / Maxi21SF) + 1 Else X21 = N21 / Maxi21SF
'on cherche le tps maxi en fonction du nb de trajets max que peuvent réaliser les camions
MaxiT21 = X21 * maxi
'tps libre du dernier camion de la flotte
TapresT21 = (MaxiT21 - s21)
'On regarde si le camion ne va pas etre sous utilisé On passe au cas suivant
If T21 <= TapresT21 And TapresT21 < T41 Then GoTo suite
'on détermine le nb de camions qu'il faut pour le double fret
TSFDF21 = Int(TapresT21 / T41) 'nb de tours en DF du dernier camion de SF
'on détermine le nb de camions qu'il faut pour le simple fret
TSFSF2131 = Int(TapresT21 / T31)
If N41 = 0 Then
X41 = 0
If Int((N31 - TSFSF2131) / Maxi31SF) < ((N31 - TSFSF2131) / Maxi31SF) Then X31 = Int((N31 - TSFSF2131) / Maxi31SF) + 1 Else X31 = ((N31 - TSFSF2131) / Maxi31SF)
Else
If Int((N41 - TSFDF21) / Maxi41DF) < ((N41 - TSFDF21) / Maxi41DF) Then X41 = Int((N41 - TSFDF21) / Maxi41DF) + 1 Else X41 = Int((N41 - TSFDF21) / Maxi41DF)
End If
If X31 <> 0 Then TapresT31 = ((X31 * Maxi31SF) - (N31 - TSFSF2131)) * T31 Else TapresT31 = 0
If X41 <> 0 Then TapresT41 = ((X41 * Maxi41DF) - (N41 - TSFDF21)) * T41 Else TapresT41 = 0
'On regarde si le camion ne va pas etre sous utiliséOn passe au cas suivant
If T41 <= TapresT41 And TapresT41 < T31 Then GoTo suite
'on détermine le nb de camions de DF qui partent en SF r
TSFDF31 = Int(TapresT41 / T31)
If N31 = 0 Then
X31 = 0
Else
If Int((N31 - TSFDF31) / Maxi31SF) < ((N31 - TSFDF31) / Maxi31SF) Then X31 = ((N31 - TSFDF31) / Maxi31SF) + 1 Else X31 = ((N31 - TSFDF31) / Maxi31SF)
End If
End If
If X31 <> 0 Then TapresT31 = ((X31 * Maxi31SF) - (N31 - TSFDF31)) * T31 Else TapresT31 = 0
'on regarde si le camion est correctement utilisé
If T31 < TapresT31 Then GoTo suite
'b) si N22=N42=N32=0, on va à la ligne suivante
If Not (N22 = 0 And N42 = 0 And N32 = 0) Then
'on détermine le nombre de camions qu'il faut pour le simple fret
'on cherche X22 tq Maxi*(X22-1)<=s22<=Maxi*X22
If Int(N22 / Maxi22SF) < N22 / Maxi22SF Then X22 = Int(N22 / Maxi22SF) + 1 Else X22 = N22 / Maxi22SF
'on cherche le tps maxi en fonction du nb de trajets max que peuvent réaliser les camions
MaxiT22 = X22 * maxi
'tps libre du dernier camion de la flotte
TapresT22 = (MaxiT22 - s22)
'On regarde si le camion ne va pas etre sous utilisé On passe au cas suivant
If T22 <= TapresT22 And TapresT22 < T42 Then GoTo suite
'on détermine le nb de camions qu'il faut pour le double fret
TSFDF22 = Int(TapresT22 / T42) 'nb de tours en DF du dernier camion de SF
'on détermine le nb de camions qu'il faut pour le simple fret
TSFSF2232 = Int(TapresT22 / T32)
If N42 = 0 Then
X42 = 0
If Int((N32 - TSFSF2232) / Maxi32SF) < ((N32 - TSFSF2232) / Maxi32SF) Then X32 = Int((N32 - TSFSF2232) / Maxi32SF) + 1 Else X32 = ((N32 - TSFSF2232) / Maxi32SF)
Else
If Int((N42 - TSFDF22) / Maxi42DF) < ((N42 - TSFDF22) / Maxi42DF) Then X42 = Int((N42 - TSFDF22) / Maxi42DF) + 1 Else X42 = Int((N42 - TSFDF22) / Maxi42DF)
End If
If X32 <> 0 Then TapresT32 = ((X32 * Maxi32SF) - (N32 - TSFSF2232)) * T32 Else TapresT32 = 0
If X42 <> 0 Then TapresT42 = ((X42 * Maxi42DF) - (N42 - TSFDF22)) * T42 Else TapresT42 = 0
'On regarde si le camion ne va pas etre sous utiliséOn passe au cas suivant
If T42 <= TapresT42 And TapresT42 < T32 Then GoTo suite
'on détermine le nb de camions de DF qui partent en SF r
TSFDF32 = Int(TapresT42 / T32)
If N32 = 0 Then
X32 = 0
Else
If Int((N32 - TSFDF32) / Maxi32SF) < ((N32 - TSFDF32) / Maxi32SF) Then X32 = ((N32 - TSFDF32) / Maxi32SF) + 1 Else X32 = ((N32 - TSFDF32) / Maxi32SF)
End If
End If
If X32 <> 0 Then TapresT32 = ((X32 * Maxi32SF) - (N32 - TSFDF32)) * T32 Else TapresT32 = 0
'on regarde si le camion est correctement utilisé
If T32 < TapresT32 Then GoTo suite
'c) si N23=N43=N33=0, on va à la ligne suivante
If Not (N23 = 0 And N43 = 0 And N33 = 0) Then
'on détermine le nombre de camions qu'il faut pour le simple fret
'on cherche X23 tq Maxi*(X23-1)<=s23<=Maxi*X23
If Int(N23 / Maxi23SF) < N23 / Maxi23SF Then X23 = Int(N23 / Maxi23SF) + 1 Else X23 = N23 / Maxi23SF
'on cherche le tps maxi en fonction du nb de trajets max que peuvent réaliser les camions
MaxiT23 = X23 * maxi
'tps libre du dernier camion de la flotte
TapresT23 = (MaxiT23 - s23)
'On regarde si le camion ne va pas etre sous utilisé On passe au cas suivant
If T23 <= TapresT23 And TapresT23 < T43 Then GoTo suite
'on détermine le nb de camions qu'il faut pour le double fret
TSFDF23 = Int(TapresT23 / T43) 'nb de tours en DF du dernier camion de SF
'on détermine le nb de camions qu'il faut pour le simple fret
TSFSF2333 = Int(TapresT23 / T33)
If N43 = 0 Then
X43 = 0
If Int((N33 - TSFSF2333) / Maxi33SF) < ((N33 - TSFSF2333) / Maxi33SF) Then X33 = Int((N33 - TSFSF2333) / Maxi33SF) + 1 Else X33 = ((N33 - TSFSF2333) / Maxi33SF)
Else
If Int((N43 - TSFDF23) / Maxi43DF) < ((N43 - TSFDF23) / Maxi43DF) Then X43 = Int((N43 - TSFDF23) / Maxi43DF) + 1 Else X43 = Int((N43 - TSFDF23) / Maxi43DF)
End If
If X33 <> 0 Then TapresT33 = ((X33 * Maxi33SF) - (N33 - TSFSF2333)) * T33 Else TapresT33 = 0
If X43 <> 0 Then TapresT43 = ((X43 * Maxi43DF) - (N43 - TSFDF23)) * T43 Else TapresT43 = 0
'On regarde si le camion ne va pas etre sous utiliséOn passe au cas suivant
If T43 <= TapresT43 And TapresT43 < T33 Then GoTo suite
'on détermine le nb de camions de DF qui partent en SF r
TSFDF33 = Int(TapresT43 / T33)
If N33 = 0 Then
X33 = 0
Else
If Int((N33 - TSFDF33) / Maxi33SF) < ((N33 - TSFDF33) / Maxi33SF) Then X33 = ((N33 - TSFDF33) / Maxi33SF) + 1 Else X33 = ((N33 - TSFDF33) / Maxi33SF)
End If
End If
If X33 <> 0 Then TapresT33 = ((X33 * Maxi33SF) - (N33 - TSFDF33)) * T33 Else TapresT33 = 0
'on regarde si le camion est correctement utilisé
If T33 < TapresT33 Then GoTo suite
'd) si N24=N44=N34=0, on va à la ligne suivante
If Not (N24 = 0 And N44 = 0 And N34 = 0) Then
'on détermine le nombre de camions qu'il faut pour le simple fret
'on cherche X24 tq Maxi*(X24-1)<=s24<=Maxi*X24
If Int(N24 / Maxi24SF) < N24 / Maxi24SF Then X24 = Int(N24 / Maxi24SF) + 1 Else X24 = N24 / Maxi24SF
'on cherche le tps maxi en fonction du nb de trajets max que peuvent réaliser les camions
MaxiT24 = X24 * maxi
'tps libre du dernier camion de la flotte
TapresT24 = (MaxiT24 - s24)
'On regarde si le camion ne va pas etre sous utilisé On passe au cas suivant
If T24 <= TapresT24 And TapresT24 < T44 Then GoTo suite
'on détermine le nb de camions qu'il faut pour le double fret
TSFDF24 = Int(TapresT24 / T44) 'nb de tours en DF du dernier camion de SF
'on détermine le nb de camions qu'il faut pour le simple fret
TSFSF2434 = Int(TapresT24 / T34)
If N44 = 0 Then
X44 = 0
If Int((N34 - TSFSF2434) / Maxi34SF) < ((N34 - TSFSF2434) / Maxi34SF) Then X34 = Int((N34 - TSFSF2434) / Maxi34SF) + 1 Else X34 = ((N34 - TSFSF2434) / Maxi34SF)
Else
If Int((N44 - TSFDF24) / Maxi44DF) < ((N44 - TSFDF24) / Maxi44DF) Then X44 = Int((N44 - TSFDF24) / Maxi44DF) + 1 Else X44 = Int((N44 - TSFDF24) / Maxi44DF)
End If
If X34 <> 0 Then TapresT34 = ((X34 * Maxi34SF) - (N34 - TSFSF2434)) * T34 Else TapresT34 = 0
If X44 <> 0 Then TapresT44 = ((X44 * Maxi44DF) - (N44 - TSFDF24)) * T44 Else TapresT44 = 0
'On regarde si le camion ne va pas etre sous utiliséOn passe au cas suivant
If T44 <= TapresT44 And TapresT44 < T34 Then GoTo suite
'on détermine le nb de camions de DF qui partent en SF r
TSFDF34 = Int(TapresT44 / T34)
If N34 = 0 Then
X34 = 0
Else
If Int((N34 - TSFDF34) / Maxi34SF) < ((N34 - TSFDF34) / Maxi34SF) Then X34 = ((N34 - TSFDF34) / Maxi34SF) + 1 Else X34 = ((N34 - TSFDF34) / Maxi34SF)
End If
End If
If X34 <> 0 Then TapresT34 = ((X34 * Maxi34SF) - (N34 - TSFDF34)) * T34 Else TapresT34 = 0
'on regarde si le camion est correctement utilisé
If T34 < TapresT34 Then GoTo suite
'on vérifie que cette solution n'est pas déjà présente
Xtot1 = X21 + X41 + X31
Xtot2 = X22 + X42 + X32
Xtot3 = X23 + X43 + X33
Xtot4 = X24 + X44 + X34
'on regroupe ttes les infos qui caractérisent la ligne, les N, A, B, Xtot2, Xtot2, Xtot3, Xtot4
StrAntiDoublon = CStr(N21) & "-" & CStr(N41) & "-" & CStr(N31) & "-" & CStr(N22) & "-" & CStr(N42) & "-" & CStr(N32) & "-" & CStr(N23) & "-" & CStr(N43) & "-" & CStr(N33) & "-" & CStr(N24) & "-" & CStr(N44) & "-" & CStr(N34) & "-" & CStr(A) & "-" & CStr(B) & "-" & CStr(Xtot1) & "-" & CStr(Xtot2) & "-" & CStr(Xtot2) & "-" & CStr(Xtot3) & "-" & CStr(Xtot4)
'on regarde si ces infos existent déja
If DicoAntiDoublon.exists(StrAntiDoublon) Then GoTo suite
'on les rajoute puisqu'elles ne figurent pas
DicoAntiDoublon.Add StrAntiDoublon, 0
'Si le code arrive ici c'est que notre flotte est bien occupé, donc on note les résultats dans le tableau
Cells(Ligne, "A").Value = z21 * w21
Cells(Ligne, "B").Value = z41 * w41
Cells(Ligne, "C").Value = z31 * w31
Cells(Ligne, "D").Value = z22 * w22
Cells(Ligne, "E").Value = z42 * w42
Cells(Ligne, "F").Value = z32 * w32
Cells(Ligne, "G").Value = z23 * w23
Cells(Ligne, "H").Value = z43 * w43
Cells(Ligne, "I").Value = z33 * w33
Cells(Ligne, "J").Value = z24 * w24
Cells(Ligne, "K").Value = z44 * w44
Cells(Ligne, "L").Value = z34 * w34
Cells(Ligne, "M").Value = A
Cells(Ligne, "N").Value = B
Cells(Ligne, "P") = N21 * T21
Cells(Ligne, "Q") = N41 * T41
Cells(Ligne, "R") = N31 * T31
Cells(Ligne, "AA") = N22 * T22
Cells(Ligne, "AB") = N42 * T42
Cells(Ligne, "AC") = N32 * T32
Cells(Ligne, "AL") = N23 * T23
Cells(Ligne, "AM") = N43 * T43
Cells(Ligne, "AN") = N33 * T33
Cells(Ligne, "AW") = N24 * T24
Cells(Ligne, "AX") = N44 * T44
Cells(Ligne, "AY") = N34 * T34
'Xtot1 = X21 + X41 + X31
Cells(Ligne, "S") = X21
Cells(Ligne, "T") = TapresT21
Cells(Ligne, "U") = X41
Cells(Ligne, "V") = TapresT41
Cells(Ligne, "W") = X31
Cells(Ligne, "X") = TapresT31
Cells(Ligne, "Y") = Xtot1
'Xtot2 = X22 + X42 + X32
Cells(Ligne, "AD") = X22
Cells(Ligne, "AE") = TapresT22
Cells(Ligne, "AF") = X42
Cells(Ligne, "AG") = TapresT42
Cells(Ligne, "AH") = X32
Cells(Ligne, "AI") = TapresT32
Cells(Ligne, "AJ") = Xtot2
'Xtot3 = X23 + X43 + X33
Cells(Ligne, "AO") = X23
Cells(Ligne, "AP") = TapresT23
Cells(Ligne, "AQ") = X43
Cells(Ligne, "AR") = TapresT43
Cells(Ligne, "AS") = X33
Cells(Ligne, "AT") = TapresT33
Cells(Ligne, "AU") = Xtot3
'Xtot4 = X24 + X44 + X34
Cells(Ligne, "AZ") = X24
Cells(Ligne, "BA") = TapresT24
Cells(Ligne, "BB") = X44
Cells(Ligne, "BC") = TapresT44
Cells(Ligne, "BD") = X34
Cells(Ligne, "BE") = TapresT34
Cells(Ligne, "BF") = Xtot4
Cells(Ligne, "BH") = (X21 + X41 + X31) * 420 + (X22 + X42 + X32) * 480 + (X23 + X43 + X33) * 550 + (X24 + X44 + X34) * 600
Ligne = Ligne + 1
End If
suite:
Next
Next
Next
Next
Next
Next
Next
Next
Next
Next
Next
Next
Next
Next
Next
Next
Next
Next
Next
Next
Next
Next
Next
Next
DicoAntiDoublon.RemoveAll
Set DicoAntiDoublon = Nothing
Application.ScreenUpdating = True
End Sub |