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 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690
|
Private Sub BRN_BARRE_JOUEUR_Click()
Unload Me
UserForm4.Show
End Sub
Private Sub BTN_BARRE_DISTRIBUTION_Click()
For Totaljoueur = 2 To 10000
If Cells(Totaljoueur, 1).Value = "" Then
Exit For
End If
Next Totaljoueur
Totaljoueur = Totaljoueur - 1
' Vérification de la présence
Compteur2 = 1
For Compteur = 2 To Totaljoueur
If Cells(Compteur, 3).Value = 1 Then
tableaupresence(Compteur2) = Cells(Compteur, 1).Value
Compteur2 = Compteur2 + 1
End If
Next Compteur
' tri selon priorite
E1 = 1
E2 = 1
E3 = 1
For Compteur = 1 To Totaljoueur
For Compteur2 = 2 To Totaljoueur
If tableaupresence(Compteur) = Cells(Compteur2, 1).Value Then
If Cells(Compteur2, 2).Value = 1 Then
tableaupresencenormale(E1, 1) = Cells(Compteur2, 1).Value
tableaupresencenormale(E1, 2) = Cells(Compteur2, 5).Value
tableaupresencenormale(E1, 3) = Cells(Compteur2, 6).Value
tableaupresencenormale(E1, 4) = Cells(Compteur2, 11).Value
tableaupresencenormale(E1, 5) = Cells(Compteur2, 12).Value
E1 = E1 + 1
Else
If Cells(Compteur2, 2).Value = 2 Then
tableaupresenceMission(E2, 1) = Cells(Compteur2, 1).Value
tableaupresenceMission(E2, 2) = Cells(Compteur2, 5).Value
tableaupresenceMission(E2, 3) = Cells(Compteur2, 6).Value
tableaupresenceMission(E2, 4) = Cells(Compteur2, 11).Value
tableaupresenceMission(E2, 5) = Cells(Compteur2, 12).Value
E2 = E2 + 1
Else
If Cells(Compteur2, 2).Value = 3 Then
tableaupresenceTransfo(E3, 1) = Cells(Compteur2, 1).Value
tableaupresenceTransfo(E3, 2) = Cells(Compteur2, 5).Value
tableaupresenceTransfo(E3, 3) = Cells(Compteur2, 6).Value
tableaupresenceTransfo(E3, 4) = Cells(Compteur2, 11).Value
tableaupresenceTransfo(E3, 5) = Cells(Compteur2, 12).Value
E3 = E3 + 1
End If
End If
End If
End If
Next Compteur2
Next Compteur
'tri selon besoins
For Compteur = 1 To Totaljoueur
If tableaupresenceTransfo(Compteur, 4) = "1" Then
tableaupresenceTransfo(Compteur, 2) = 0
End If
If tableaupresenceTransfo(Compteur, 5) = "1" Then
tableaupresenceTransfo(Compteur, 3) = 0
End If
Next Compteur
For Compteur = 1 To Totaljoueur
If tableaupresenceMission(Compteur, 4) = "1" Then
tableaupresenceMission(Compteur, 2) = 0
End If
If tableaupresenceMission(Compteur, 5) = "1" Then
tableaupresenceMission(Compteur, 3) = 0
End If
Next Compteur
For Compteur = 1 To Totaljoueur
If tableaupresencenormale(Compteur, 4) = "1" Then
tableaupresencenormale(Compteur, 2) = 0
End If
If tableaupresencenormale(Compteur, 5) = "1" Then
tableaupresencenormale(Compteur, 3) = 0
End If
Next Compteur
Compteur3 = 1
For Compteur = 1 To Totaljoueur
For Compteur2 = 2 To Totaljoueur
If Cells(Compteur2, 1).Value = tableaupresenceTransfo(Compteur, 1) Then
If TotalOr + tableaupresenceTransfo(Compteur, 2) > 0 Then
If tableaupresenceTransfo(Compteur, 2) < MaxOr Then
Cells(Compteur3, 34).Value = tableaupresenceTransfo(Compteur, 1)
Cells(Compteur3, 35).Value = tableaupresenceTransfo(Compteur, 2)
Compteur3 = Compteur3 + 1
TotalOr = TotalOr - tableaupresenceTransfo(Compteur, 2)
tableaupresenceTransfo(Compteur, 2) = 0
Else
If tableaupresenceTransfo(Compteur, 2) = MaxOr Then
Cells(Compteur3, 34).Value = tableaupresenceTransfo(Compteur, 1)
Cells(Compteur3, 35).Value = tableaupresenceTransfo(Compteur, 2)
Compteur3 = Compteur3 + 1
tableaupresenceTransfo(Compteur, 2) = 0
TotalOr = TotalOr - MaxOr
Else
If tableaupresenceTransfo(Compteur, 2) > MaxOr Then
Cells(Compteur3, 34).Value = tableaupresenceTransfo(Compteur, 1)
Cells(Compteur3, 35).Value = MaxOr
Compteur3 = Compteur3 + 1
tableaupresenceTransfo(Compteur, 2) = tableaupresenceTransfo(Compteur, 2) - MaxOr
TotalOr = TotalOr - MaxOr
End If
End If
End If
End If
End If
Next Compteur2
Next Compteur
For Compteur = 1 To Totaljoueur
For Compteur2 = 2 To Totaljoueur
If Cells(Compteur2, 1).Value = tableaupresenceMission(Compteur, 1) Then
If TotalOr + tableaupresenceMission(Compteur, 2) > 0 Then
If tableaupresenceMission(Compteur, 2) < MaxOr Then
Cells(Compteur3, 34).Value = tableaupresenceMission(Compteur, 1)
Cells(Compteur3, 35).Value = tableaupresenceMission(Compteur, 2)
Compteur3 = Compteur3 + 1
TotalOr = TotalOr - tableaupresenceMission(Compteur, 2)
tableaupresenceMission(Compteur, 2) = 0
Else
If tableaupresenceMission(Compteur, 2) = MaxOr Then
Cells(Compteur3, 34).Value = tableaupresenceMission(Compteur, 1)
Cells(Compteur3, 35).Value = tableaupresenceMission(Compteur, 2)
Compteur3 = Compteur3 + 1
tableaupresenceMission(Compteur, 2) = 0
TotalOr = TotalOr - MaxOr
Else
If tableaupresenceMission(Compteur, 2) > MaxOr Then
Cells(Compteur3, 34).Value = tableaupresenceMission(Compteur, 1)
Cells(Compteur3, 35).Value = MaxOr
Compteur3 = Compteur3 + 1
tableaupresenceMission(Compteur, 2) = tableaupresenceMission(Compteur, 2) - MaxOr
TotalOr = TotalOr - MaxOr
End If
End If
End If
End If
End If
Next Compteur2
Next Compteur
For Compteur = 1 To Totaljoueur
For Compteur2 = 2 To Totaljoueur
If Cells(Compteur2, 1).Value = tableaupresencenormale(Compteur, 1) Then
If TotalOr - tableaupresencenormale(Compteur, 2) > 0 Then
If tableaupresencenormale(Compteur, 2) < MaxOr Then
Cells(Compteur3, 34).Value = tableaupresencenormale(Compteur, 1)
Cells(Compteur3, 35).Value = tableaupresencenormale(Compteur, 2)
Compteur3 = Compteur3 + 1
TotalOr = TotalOr - tableaupresencenormale(Compteur, 2)
tableaupresencenormale(Compteur, 2) = 0
Else
If tableaupresencenormale(Compteur, 2) = MaxOr Then
Cells(Compteur3, 34).Value = tableaupresencenormale(Compteur, 1)
Cells(Compteur3, 35).Value = tableaupresencenormale(Compteur, 2)
Compteur3 = Compteur3 + 1
tableaupresencenormale(Compteur, 2) = 0
TotalOr = TotalOr - MaxOr
Else
If tableaupresencenormale(Compteur, 2) > MaxOr Then
Cells(Compteur3, 34).Value = tableaupresencenormale(Compteur, 1)
Cells(Compteur3, 35).Value = MaxOr
Compteur3 = Compteur3 + 1
tableaupresencenormale(Compteur, 2) = tableaupresencenormale(Compteur, 2) - MaxOr
TotalOr = TotalOr - MaxOr
End If
End If
End If
End If
End If
Next Compteur2
Next Compteur
For Compteur = 1 To Totaljoueur
For Compteur2 = 2 To Totaljoueur
If Cells(Compteur2, 1).Value = tableaupresenceTransfo(Compteur, 1) Then
If TotalArgent - tableaupresenceTransfo(Compteur, 3) > 0 Then
If tableaupresenceTransfo(Compteur, 3) < MaxArgent Then
For Compteur3 = 1 To Totaljoueur
If Cells(Compteur3, 34).Value = tableaupresenceTransfo(Compteur, 1) Then
Cells(Compteur3, 36).Value = tableaupresenceTransfo(Compteur, 3)
TotalArgent = TotalArgent - tableaupresenceTransfo(Compteur, 3)
tableaupresenceTransfo(Compteur, 3) = 0
End If
Next Compteur3
Else
If tableaupresenceTransfo(Compteur, 2) = MaxArgent Then
For Compteur3 = 1 To Totaljoueur
If Cells(Compteur3, 34).Value = tableaupresenceTransfo(Compteur, 1) Then
Cells(Compteur3, 36).Value = tableaupresenceTransfo(Compteur, 3)
TotalArgent = TotalArgent - MaxArgent
tableaupresenceTransfo(Compteur, 3) = 0
End If
Next Compteur3
Else
If tableaupresenceTransfo(Compteur, 2) > MaxArgent Then
For Compteur3 = 1 To Totaljoueur
If Cells(Compteur3, 34).Value = tableaupresenceTransfo(Compteur, 1) Then
Cells(Compteur3, 36).Value = MaxArgent
TotalArgent = TotalArgent - MaxArgent
tableaupresenceTransfo(Compteur, 3) = tableaupresenceTransfo(Compteur, 3) - MaxArgent
End If
Next Compteur3
End If
End If
End If
End If
End If
Next Compteur2
Next Compteur
For Compteur = 1 To Totaljoueur
For Compteur2 = 2 To Totaljoueur
If Cells(Compteur2, 1).Value = tableaupresenceMission(Compteur, 1) Then
If TotalArgent - tableaupresenceMission(Compteur, 3) > 0 Then
If tableaupresenceMission(Compteur, 3) < MaxArgent Then
For Compteur3 = 1 To Totaljoueur
If Cells(Compteur3, 34).Value = tableaupresenceMission(Compteur, 1) Then
Cells(Compteur3, 36).Value = tableaupresenceMission(Compteur, 3)
TotalArgent = TotalArgent - tableaupresenceMission(Compteur, 3)
tableaupresenceMission(Compteur, 3) = 0
End If
Next Compteur3
Else
If tableaupresenceMission(Compteur, 2) = MaxArgent Then
For Compteur3 = 1 To Totaljoueur
If Cells(Compteur3, 34).Value = tableaupresenceMission(Compteur, 1) Then
Cells(Compteur3, 36).Value = tableaupresenceMission(Compteur, 3)
TotalArgent = TotalArgent - MaxArgent
tableaupresenceMission(Compteur, 3) = 0
End If
Next Compteur3
Else
If tableaupresenceMission(Compteur, 2) > MaxArgent Then
For Compteur3 = 1 To Totaljoueur
If Cells(Compteur3, 34).Value = tableaupresenceMission(Compteur, 1) Then
Cells(Compteur3, 36).Value = MaxArgent
TotalArgent = TotalArgent - MaxArgent
tableaupresenceMission(Compteur, 3) = tableaupresenceMission(Compteur, 3) - MaxArgent
End If
Next Compteur3
End If
End If
End If
End If
End If
Next Compteur2
Next Compteur
For Compteur = 1 To Totaljoueur
For Compteur2 = 2 To Totaljoueur
If Cells(Compteur2, 1).Value = tableaupresencenormale(Compteur, 1) Then
If TotalArgent - tableaupresencenormale(Compteur, 3) > 0 Then
If tableaupresencenormale(Compteur, 3) < MaxArgent Then
For Compteur3 = 2 To Totaljoueur
If Cells(Compteur3, 34).Value = tableaupresencenormale(Compteur, 1) Then
Cells(Compteur3, 36).Value = tableaupresencenormale(Compteur, 3)
TotalArgent = TotalArgent - tableaupresencenormale(Compteur, 3)
tableaupresencenormale(Compteur, 3) = 0
End If
Next Compteur3
Else
If tableaupresencenormale(Compteur, 2) = MaxOr Then
For Compteur3 = 1 To Totaljoueur
If Cells(Compteur3, 34).Value = tableaupresencenormale(Compteur, 1) Then
Cells(Compteur3, 36).Value = tableaupresencenormale(Compteur, 3)
TotalArgent = TotalArgent - MaxArgent
tableaupresencenormale(Compteur, 3) = 0
End If
Next Compteur3
Else
If tableaupresencenormale(Compteur, 2) > MaxOr Then
For Compteur3 = 1 To Totaljoueur
If Cells(Compteur3, 34).Value = tableaupresencenormale(Compteur, 1) Then
Cells(Compteur3, 36).Value = MaxArgent
TotalArgent = TotalArgent - MaxArgent
tableaupresencenormale(Compteur, 3) = tableaupresencenormale(Compteur, 3) - MaxArgent
End If
Next Compteur3
End If
End If
End If
End If
End If
Next Compteur2
Next Compteur
For Compteur = 1 To 9999
For Compteur2 = 0 To 4
tableaupresence(Compteur) = ""
tableaupresencenormale(Compteur, Compteur2) = ""
tableaupresenceMission(Compteur, Compteur2) = ""
tableaupresenceTransfo(Compteur, Compteur2) = ""
Next Compteur2
Next Compteur
Cells(2, 27).Value = 0
AjoutOr = 0
Cells(2, 28).Value = 0
AjoutArgent = 0
Cells(2, 29).Value = TotalOr
ResteOr = TotalOr
Cells(2, 30).Value = TotalArgent
ResteArgent = TotalArgent
Cells(2, 31).Value = 0
TotalOr = 0
Cells(2, 32).Value = 0
TotalArgent = 0
For Compteur = 1 To Totaljoueur
For Compteur2 = 1 To Totaljoueur
If Cells(Compteur, 34).Value = Cells(Compteur2, 1).Value Then
Cells(Compteur2, 5).Value = Cells(Compteur2, 5).Value - Cells(Compteur, 35).Value
Cells(Compteur2, 6).Value = Cells(Compteur2, 6).Value - Cells(Compteur, 36).Value
Cells(Compteur2, 3).Value = 0
Cells(Compteur, 35).Value = ""
Cells(Compteur, 36).Value = ""
Cells(Compteur, 34).Value = ""
End If
Next Compteur2
Next Compteur
For Compteur = 2 To Totaljoueur
If Cells(Compteur, 3).Value = 1 Then
Cells(Compteur, 2).Value = 3
Cells(Compteur, 3).Value = 0
End If
Next Compteur
Unload Me
UserForm3.Show
End Sub
Private Sub BTN_BARRE_QUITTER_Click()
Unload Me
End Sub
Private Sub BTN_BARRE_RESET_Click()
Unload Me
UserForm5.Show
End Sub
Private Sub BTN_BARRE_TAUX_Click()
Unload Me
UserForm2.Show
End Sub
Private Sub CommandButton1_Click()
For Compteur = 2 To Totaljoueur + 1
If Cells(Compteur, 1).Value = ComboBox1.Value Then
If Cells(Compteur, 2).Value = 3 Then
Else
Cells(Compteur, 2).Value = PrioriteNormale
End If
Cells(Compteur, 3).Value = 1
Cells(Compteur, 4).Value = Cells(Compteur, 4).Value + 1
Cells(Compteur, 5).Value = Cells(Compteur, 5).Value + TauxNormalOr
Cells(Compteur, 6).Value = Cells(Compteur, 6).Value + TauxNormalArgent
Cells(Compteur, 7).Value = Cells(Compteur, 7).Value + TauxNormalOr
Cells(Compteur, 8).Value = Cells(Compteur, 8).Value + TauxNormalArgent
Cells(Compteur, 9).Value = Cells(Compteur, 9).Value
Cells(Compteur, 10).Value = Cells(Compteur, 10).Value
Exit For
Else
If Cells(Compteur, 1).Value = "" Then
Cells(Compteur, 1).Value = ComboBox1.Value
If Cells(Compteur, 2).Value = 3 Then
Else
Cells(Compteur, 2).Value = PrioriteNormale
End If
Cells(Compteur, 3).Value = 1
Cells(Compteur, 4).Value = Cells(Compteur, 4).Value + 1
Cells(Compteur, 5).Value = Cells(Compteur, 5).Value + TauxNormalOr
Cells(Compteur, 6).Value = Cells(Compteur, 6).Value + TauxNormalArgent
Cells(Compteur, 7).Value = Cells(Compteur, 7).Value + TauxNormalOr
Cells(Compteur, 8).Value = Cells(Compteur, 8).Value + TauxNormalArgent
Cells(Compteur, 9).Value = Cells(Compteur, 9).Value
Cells(Compteur, 10).Value = Cells(Compteur, 10).Value
Cells(Compteur, 11).Value = 0
Cells(Compteur, 12).Value = 0
Cells(Compteur, 13).Value = ComboBox4.Value
For totallegion = 2 To 10000
If Cells(totallegion, 1).Value = "" Then
Exit For
End If
Next totallegion
totallegion = totallegion - 1
If totallegion < 2 Then
totallegion = 2
End If
For Compteur2 = 2 To totallegion
If ComboBox4.Value = Cells(Compteur2, 14).Value Then
Exit For
Else
If ComboBox4.Value = "" Then
Exit For
Else
If Cells(Compteur2, 14).Value = "" Then
Cells(Compteur2, 14).Value = ComboBox4.Value
Exit For
End If
End If
End If
Next Compteur2
Totaljoueur = Totaljoueur + 1
End If
End If
Next Compteur
ComboBox1.Value = ""
End Sub
Private Sub CommandButton2_Click()
For Compteur = 2 To Totaljoueur + 1
If Cells(Compteur, 1).Value = ComboBox2.Value Then
If Cells(Compteur, 2).Value = 3 Then
Else
Cells(Compteur, 2).Value = PrioriteMission
End If
Cells(Compteur, 2).Value = PrioriteMission
Cells(Compteur, 3).Value = 1
Cells(Compteur, 4).Value = Cells(Compteur, 4).Value + 1
Cells(Compteur, 5).Value = Cells(Compteur, 5).Value + TauxMissionOr
Cells(Compteur, 6).Value = Cells(Compteur, 6).Value + TauxMissionArgent
Cells(Compteur, 7).Value = Cells(Compteur, 7).Value + TauxMissionOr
Cells(Compteur, 8).Value = Cells(Compteur, 8).Value + TauxMissionArgent
Cells(Compteur, 9).Value = Cells(Compteur, 9).Value + 1
Cells(Compteur, 10).Value = Cells(Compteur, 10).Value
Exit For
Else
If Cells(Compteur, 1).Value = "" Then
Cells(Compteur, 1).Value = ComboBox2.Value
If Cells(Compteur, 2).Value = 3 Then
Else
Cells(Compteur, 2).Value = PrioriteMission
End If
Cells(Compteur, 3).Value = 1
Cells(Compteur, 4).Value = Cells(Compteur, 4).Value + 1
Cells(Compteur, 5).Value = Cells(Compteur, 5).Value + TauxMissionOr
Cells(Compteur, 6).Value = Cells(Compteur, 6).Value + TauxMissionArgent
Cells(Compteur, 7).Value = Cells(Compteur, 7).Value + TauxMissionOr
Cells(Compteur, 8).Value = Cells(Compteur, 8).Value + TauxMissionArgent
Cells(Compteur, 9).Value = Cells(Compteur, 9).Value + 1
Cells(Compteur, 10).Value = Cells(Compteur, 10).Value
Cells(Compteur, 11).Value = 0
Cells(Compteur, 12).Value = 0
Cells(Compteur, 13).Value = ComboBox5.Value
For totallegion = 2 To 10000
If Cells(totallegion, 1).Value = "" Then
Exit For
End If
Next totallegion
totallegion = totallegion - 1
If totallegion < 2 Then
totallegion = 2
End If
For Compteur2 = 2 To totallegion
If ComboBox5.Value = Cells(Compteur2, 14).Value Then
Exit For
Else
If ComboBox5.Value = "" Then
Exit For
Else
If Cells(Compteur2, 14).Value = "" Then
Cells(Compteur2, 14).Value = ComboBox5.Value
Exit For
End If
End If
End If
Next Compteur2
Totaljoueur = Totaljoueur + 1
End If
End If
Next Compteur
ComboBox2.Value = ""
End Sub
Private Sub CommandButton3_Click()
For Compteur = 2 To Totaljoueur + 1
If Cells(Compteur, 1).Value = ComboBox3.Value Then
If Cells(Compteur, 2).Value = 3 Then
Else
Cells(Compteur, 2).Value = PrioriteTransfo
End If
Cells(Compteur, 3).Value = 1
Cells(Compteur, 4).Value = Cells(Compteur, 4).Value + 1
Cells(Compteur, 5).Value = TauxTransfoOr
Cells(Compteur, 6).Value = TauxTransfoArgent
Cells(Compteur, 7).Value = Cells(Compteur, 7).Value + TauxTransfoOr
Cells(Compteur, 8).Value = Cells(Compteur, 8).Value + TauxTransfoArgent
Cells(Compteur, 9).Value = Cells(Compteur, 9).Value
Cells(Compteur, 10).Value = Cells(Compteur, 10).Value + 1
Exit For
Else
If Cells(Compteur, 1).Value = "" Then
Cells(Compteur, 1).Value = ComboBox3.Value
If Cells(Compteur, 2).Value = 3 Then
Else
Cells(Compteur, 2).Value = PrioriteTransfo
End If
Cells(Compteur, 3).Value = 1
Cells(Compteur, 4).Value = Cells(Compteur, 4).Value + 1
Cells(Compteur, 5).Value = Cells(Compteur, 6).Value + TauxTransfoOr
Cells(Compteur, 6).Value = Cells(Compteur, 6).Value + TauxTransfoArgent
Cells(Compteur, 7).Value = Cells(Compteur, 7).Value + TauxTransfoOr
Cells(Compteur, 8).Value = Cells(Compteur, 8).Value + TauxTransfoArgent
Cells(Compteur, 9).Value = Cells(Compteur, 9).Value
Cells(Compteur, 10).Value = Cells(Compteur, 10).Value + 1
Cells(Compteur, 11).Value = 0
Cells(Compteur, 12).Value = 0
Cells(Compteur, 13).Value = ComboBox6.Value
For totallegion = 2 To 10000
If Cells(totallegion, 1).Value = "" Then
Exit For
End If
Next totallegion
totallegion = totallegion - 1
If totallegion < 2 Then
totallegion = 2
End If
For Compteur2 = 2 To totallegion
If ComboBox6.Value = Cells(Compteur2, 14).Value Then
Exit For
Else
If ComboBox6.Value = "" Then
Exit For
Else
If Cells(Compteur2, 14).Value = "" Then
Cells(Compteur2, 14).Value = ComboBox6.Value
Exit For
End If
End If
End If
Next Compteur2
Totaljoueur = Totaljoueur + 1
End If
End If
Next Compteur
ComboBox3.Value = ""
End Sub
Private Sub CommandButton4_Click()
For Compteur = 2 To Totaljoueur
If Cells(Compteur, 1).Value = ComboBox7.Value Then
Cells(Compteur, 1).Value = TextBox7.Value
End If
Next Compteur
End Sub
Private Sub CommandButton5_Click()
legion = ComboBox9.Value
For Compteur = 2 To Totaljoueur
If Cells(Compteur, 13).Value = legion Then
Cells(Compteur, 13).Value = TextBox8.Value
End If
Next Compteur
For Compteur = 2 To Totaljoueur
If Cells(Compteur, 14).Value = legion Then
Cells(Compteur, 14).Value = TextBox8.Value
End If
Next Compteur
End Sub
Private Sub TextBox1_Change()
If TextBox1.Value = "" Then
TextBox1.Value = 0
End If
AjoutOr = TextBox1.Value
Cells(2, 27).Value = AjoutOr
Cells(2, 31).Value = AjoutOr + ResteOr
TotalOr = AjoutOr + ResteOr
TextBox5.Value = TotalOr
End Sub
Private Sub TextBox2_Change()
If TextBox2.Value = "" Then
TextBox2.Value = 0
End If
AjoutArgent = TextBox2.Value
Cells(2, 28).Value = AjoutArgent
Cells(2, 32).Value = AjoutArgent + ResteArgent
TotalArgent = AjoutArgent + ResteArgent
TextBox6.Value = TotalArgent
End Sub
Private Sub TextBox3_Change()
If TextBox3.Value = "" Then
TextBox3.Value = 0
End If
ResteOr = TextBox3.Value
Cells(2, 29).Value = ResteOr
Cells(2, 31).Value = AjoutOr + ResteOr
TotalOr = AjoutOr + ResteOr
TextBox5.Value = TotalOr
End Sub
Private Sub TextBox5_Change()
If TextBox5.Value = "" Then
TextBox5.Value = 0
End If
TextBox5.Value = TotalOr
Cells(2, 31).Value = TotalOr
End Sub
Private Sub TextBox6_Change()
If TextBox6.Value = "" Then
TextBox6.Value = 0
End If
TextBox6.Value = TotalArgent
Cells(2, 32).Value = TotalArgent
End Sub
Private Sub Userform_Initialize()
OteCroix Me
Compteur = 0
Compteur2 = 0
Totaljoueur = 0
MaxOr = Cells(2, 15).Value
MaxArgent = Cells(2, 16).Value
AjoutOr = Cells(2, 27).Value
AjoutArgent = Cells(2, 28).Value
ResteOr = Cells(2, 29).Value
ResteArgent = Cells(2, 30).Value
TotalOr = AjoutOr + ResteOr
TotalArgent = AjoutArgent + ResteArgent
TauxNormalOr = Cells(2, 17).Value
TauxNormalArgent = Cells(2, 18).Value
TauxMissionOr = Cells(2, 19).Value
TauxMissionArgent = Cells(2, 20).Value
TauxTransfoOr = Cells(2, 21).Value
TauxTransfoArgent = Cells(2, 22).Value
PrioriteNormale = Cells(2, 23).Value
PrioriteMission = Cells(2, 24).Value
PrioriteTransfo = Cells(2, 25).Value
TextBox1.Value = Cells(2, 27).Value
TextBox3.Value = Cells(2, 29).Value
TextBox2.Value = Cells(2, 28).Value
TextBox4.Value = Cells(2, 30).Value
TextBox5.Value = TotalOr
TextBox6.Value = TotalArgent
For Totaljoueur = 2 To 10000
If Cells(Totaljoueur, 1).Value = "" Then
Exit For
End If
Next Totaljoueur
Totaljoueur = Totaljoueur - 1
For totallegion = 2 To 10000
If Cells(totallegion, 14).Value = "" Then
Exit For
End If
Next totallegion
totallegion = totallegion - 1
ComboBox1.RowSource = "Feuil1!A2:A" & Totaljoueur
ComboBox2.RowSource = "Feuil1!A2:A" & Totaljoueur
ComboBox3.RowSource = "Feuil1!A2:A" & Totaljoueur
ComboBox4.RowSource = "Feuil1!n2:n" & totallegion
ComboBox5.RowSource = "Feuil1!n2:n" & totallegion
ComboBox6.RowSource = "Feuil1!n2:n" & totallegion
ComboBox7.RowSource = "Feuil1!A2:A" & Totaljoueur
ComboBox9.RowSource = "Feuil1!n2:n" & totallegion
End Sub
Private Sub TextBox4_Change()
ResteArgent = TextBox4.Value
Cells(2, 30).Value = ResteArgent
Cells(2, 32).Value = AjoutArgent + ResteArgent
TotalArgent = AjoutArgent + ResteArgent
TextBox6.Value = TotalArgent
End Sub |