IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

Macros et VBA Excel Discussion :

question de procedure pour accelerer le traitement


Sujet :

Macros et VBA Excel

  1. #1
    Membre averti
    Profil pro
    Inscrit en
    Juin 2008
    Messages
    30
    Détails du profil
    Informations personnelles :
    Âge : 53
    Localisation : France

    Informations forums :
    Inscription : Juin 2008
    Messages : 30
    Par défaut question de procedure pour accelerer le traitement
    Bonjour tt le monde,

    Voila, au boulot, je suis en train de creer un classeur qui sort des statistique pour faire des suivis des installation.

    En gros, j'exporte les fichiers d'historique de fonctionnement, défauts...etc...; je les met en forme, je trie..etc; et ensuite, toujours en macro, j'en sort des graphiques avec des tableaux croisés dynamique et plein de chose parmis ce qu'excel me permet de faire.

    ma question est la suivante: pour le pratique et la vitesse d'execution des macro (car elles sont en fait mises bout a bout) vaut-il mieux tout mettre dans un seul classeur ou les dispatcher par taches (par exemple : 1 classeur mise en forme de liste, ensuite un classeur créations de tableau croisés...) et relier les classeurs entre eux?

  2. #2
    Membre chevronné Avatar de J.Michel
    Inscrit en
    Septembre 2007
    Messages
    279
    Détails du profil
    Informations personnelles :
    Âge : 62

    Informations forums :
    Inscription : Septembre 2007
    Messages : 279
    Par défaut
    En dispatchant tes macros sur plusieurs classeurs, tu auras plusieurs classeurs à ouvrir donc plus de temps à l'ouverture.
    Personellement je pense que tu ralentirait le processus (mais je n'ai jamais fait ce genre de test)

  3. #3
    Membre Expert
    Profil pro
    Inscrit en
    Novembre 2006
    Messages
    1 567
    Détails du profil
    Informations personnelles :
    Âge : 62
    Localisation : France

    Informations forums :
    Inscription : Novembre 2006
    Messages : 1 567
    Par défaut
    a priori cela n'aurait aucun interet
    1 les macro ne s'executeraient pas en même temps pour cela
    2 tu perdrai le temps pour fermer et ouvrir tes classeurs. et le faire par macro ne ferai que rajouter du temps
    3 les liaisons ont un "poids" et plus tes classeurs seront lourd, plus ils seraient difficile a manipuler, donc plus long.
    5 tu peux lancer ta macro et aller boire le café, avec plusieurs macro tu vas devoir guetter la fin d'une pour lancer l'autre
    6 pourquoi faire simple quand on peu faire compliqué ?

  4. #4
    Membre averti
    Profil pro
    Inscrit en
    Juin 2008
    Messages
    30
    Détails du profil
    Informations personnelles :
    Âge : 53
    Localisation : France

    Informations forums :
    Inscription : Juin 2008
    Messages : 30
    Par défaut
    daccord, c une question que je me posait (je préfers la poser et être sur) car mon classeur atteint les 20 Mo et il n'a pas fini de grossir. Mais je ne me rends pas compte, est-ce gros? ou est-ce que j'ai de la marge avant qu'il soit traité d'obèse?

  5. #5
    Expert confirmé
    Avatar de fring
    Homme Profil pro
    Engineering
    Inscrit en
    Février 2008
    Messages
    3 900
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 62
    Localisation : Belgique

    Informations professionnelles :
    Activité : Engineering

    Informations forums :
    Inscription : Février 2008
    Messages : 3 900
    Par défaut
    Bonjour,

    Oui c'est énorme pour un classeur Excel.
    C'est souvent suite à une mauvaise utilisation lors des mises en page.
    Si tu as 10 cellules à mettre en forme (par exemple tracer les bordures) et que tu sélectionnes la colonne entière, Excel mettra en forme les 65535 cellules de la colonne et gardera en mémoire cette mise en forme même si les cellules sont vides. Alors imagine pour 10...20...50 colonnes sur plusieurs feuilles !

    Un premier nettoyage à faire est de sélectionner toutes les lignes vides jusqu'à la ligne 65535 et de supprimer ces lignes, pas le contenu mais la ligne complète. Faire la même chose pour les colonnes. Et ce sur chaque feuille.

  6. #6
    Membre averti
    Profil pro
    Inscrit en
    Juin 2008
    Messages
    30
    Détails du profil
    Informations personnelles :
    Âge : 53
    Localisation : France

    Informations forums :
    Inscription : Juin 2008
    Messages : 30
    Par défaut
    Bonjour fring

    plusieurs problemes:
    _vu que c un historique il y a plusieur liste, et je ne peut pas dire a l'avance combien de lignes elles comporterons (suivant les mois, ca varie tt le temps) mais ça devrais s'arranger, il me semble que j'ai deja vu ce sujet en naviguant, je vais chercher.

    _Toutes les macros (sauf celle pour laquelle tu m'as aider) je les ai fait moi-même avec la commande "enregistrer une macro" et en modifiant certaine choses moi-même avec ce que je trouvais sur le net, donc je suis sur qu'elle sont horriblement trop longues et largement optimisables mais je n'ai pas les connaissance necessaires pour le faire

    _des infos contenus dans les listes d'historique sont en doublons et par la suite, j'essaierais au lieu d'avoir plusieurs petites listes, d'en avoir une plus grosses mais sans doublons d'infos

    _Enfin, etant débutant, je construit mon classeur au fur et a mesure de son avancement et lorsque une nouvelle tache est a construire, ne sachant pas l'incorporer au reste, je la met a la suite de ce qui a été fait.

    en plus, le temps me manque, l'installation serat entierement opérationnelle dans quelque mois et je n'aurais pas le temps d'apprendre assez vite pour tout optimiser, la programmation, faut pas oublier que c'est un métier quand même et c pas facile.

  7. #7
    Membre averti
    Profil pro
    Inscrit en
    Juin 2008
    Messages
    30
    Détails du profil
    Informations personnelles :
    Âge : 53
    Localisation : France

    Informations forums :
    Inscription : Juin 2008
    Messages : 30
    Par défaut
    Voici une des macro, il est certain que ca va horrifier ceux qui vont la lire!!!



    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    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
    691
    692
    693
    694
    695
    696
    697
    698
    699
    700
    701
    702
    703
    704
    705
    706
    707
    708
    709
    710
    711
    712
    713
    714
    715
    716
    717
    718
    719
    720
    721
    722
    723
    724
    725
    726
    727
    728
    729
    730
    731
    732
    733
    734
    735
    736
    737
    738
    739
    740
    741
    742
    743
    744
    745
    746
    747
    748
    749
    750
    751
    752
    753
    754
    755
    756
    757
    758
    759
    760
    761
    762
    763
    764
    765
    766
    767
    768
    769
    770
    771
    772
    773
    774
    775
    776
    777
    778
    779
    780
    781
    782
    783
    784
    785
    786
    787
    788
    789
    790
    791
    792
    793
    Application.ScreenUpdating = False
        Sheets.Add
        ActiveSheet.Select
        ActiveSheet.Move After:=Sheets(28)
     
        ActiveSheet.Name = "défaut %"
        Sheets("R01").Select
        Columns("A:B").Select
        Selection.Copy
        Sheets("défaut %").Select
        Columns("A:A").Select
        Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
            :=False, Transpose:=False
        Sheets("R02").Select
        Columns("A:B").Select
        Application.CutCopyMode = False
        Selection.Copy
        Sheets("défaut %").Select
        Columns("H:H").Select
        Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
            :=False, Transpose:=False
        Sheets("R03").Select
        Columns("A:B").Select
        Application.CutCopyMode = False
        Selection.Copy
        Sheets("défaut %").Select
        Columns("O:O").Select
        Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
            :=False, Transpose:=False
        ActiveWindow.ScrollColumn = 3
        ActiveWindow.SmallScroll ToRight:=11
        Sheets("R04").Select
        Columns("A:B").Select
        Application.CutCopyMode = False
        Selection.Copy
        Sheets("défaut %").Select
        Columns("V:V").Select
        Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
            :=False, Transpose:=False
        Sheets("R05").Select
        Columns("A:B").Select
        Application.CutCopyMode = False
        Selection.Copy
        Sheets("défaut %").Select
        Columns("AC:AC").Select
        Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
            :=False, Transpose:=False
        Sheets("R06").Select
        Columns("A:B").Select
        Application.CutCopyMode = False
        Selection.Copy
        Sheets("défaut %").Select
        Columns("AJ:AJ").Select
        Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
            :=False, Transpose:=False
        ActiveWindow.SmallScroll ToRight:=11
        Sheets("R07").Select
        Columns("A:B").Select
        Application.CutCopyMode = False
        Selection.Copy
        Sheets("défaut %").Select
        Columns("AQ:AQ").Select
     
        Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
            :=False, Transpose:=False
        ActiveWindow.SmallScroll ToRight:=8
        Sheets("R08").Select
        Columns("A:B").Select
        Application.CutCopyMode = False
        Selection.Copy
        Sheets("défaut %").Select
        Columns("AX:AX").Select
     
        Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
            :=False, Transpose:=False
        Sheets("R09").Select
        Columns("A:B").Select
        Application.CutCopyMode = False
        Selection.Copy
        Sheets("défaut %").Select
        ActiveWindow.SmallScroll ToRight:=1
        Columns("BE:BE").Select
        Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
            :=False, Transpose:=False
        Sheets("R10").Select
        Columns("A:B").Select
        Application.CutCopyMode = False
        Selection.Copy
        Sheets("défaut %").Select
        Columns("BL:BL").Select
        Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
            :=False, Transpose:=False
        ActiveWindow.ScrollColumn = 1
     
     
     
        Sheets("Total nbre défaut tout TK").Select
        Columns("A:B").Select
        Application.CutCopyMode = False
        Selection.Copy
        Sheets("défaut %").Select
        Columns("BS:BS").Select
        Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
            :=False, Transpose:=False
        ActiveWindow.ScrollColumn = 1
        Sheets("Liste des défauts").Select
        Range("H17:I19").Select
        Application.CutCopyMode = False
        Selection.Copy
        Sheets("défaut %").Select
        Range("D1").Select
        ActiveSheet.Paste
        Sheets("Liste des défauts").Select
        Range("J17:K19").Select
        Application.CutCopyMode = False
        Selection.Copy
        Sheets("défaut %").Select
        Range("K1").Select
        ActiveSheet.Paste
        ActiveWindow.SmallScroll ToRight:=12
        Sheets("Liste des défauts").Select
        Range("L17:M19").Select
        Application.CutCopyMode = False
        Selection.Copy
        Sheets("défaut %").Select
        Range("R1").Select
        ActiveSheet.Paste
        Sheets("Liste des défauts").Select
        Range("N17:O19").Select
        Application.CutCopyMode = False
        Selection.Copy
        Sheets("défaut %").Select
        Range("Y1").Select
        ActiveSheet.Paste
        ActiveWindow.SmallScroll ToRight:=15
        Sheets("Liste des défauts").Select
        ActiveWindow.SmallScroll ToRight:=14
        Range("P17:Q19").Select
        Application.CutCopyMode = False
        Selection.Copy
        Sheets("défaut %").Select
        Range("AF1").Select
        ActiveSheet.Paste
        Sheets("Liste des défauts").Select
        Range("R17:S19").Select
        Application.CutCopyMode = False
        Selection.Copy
        Sheets("défaut %").Select
        Range("AM1").Select
        ActiveSheet.Paste
        ActiveWindow.SmallScroll ToRight:=14
        Sheets("Liste des défauts").Select
        Range("T17:U19").Select
        Application.CutCopyMode = False
        Selection.Copy
        Sheets("défaut %").Select
        Range("AT1").Select
        ActiveSheet.Paste
        Sheets("Liste des défauts").Select
        Range("V17:W19").Select
        Application.CutCopyMode = False
        Selection.Copy
        Sheets("défaut %").Select
        Range("BA1").Select
        ActiveSheet.Paste
        ActiveWindow.SmallScroll ToRight:=12
        Sheets("Liste des défauts").Select
        Range("X17:Y19").Select
        Application.CutCopyMode = False
        Selection.Copy
        Sheets("défaut %").Select
        Range("BH1").Select
        ActiveSheet.Paste
        Sheets("Liste des défauts").Select
        Range("Z17:AA19").Select
        Application.CutCopyMode = False
        Selection.Copy
        Sheets("défaut %").Select
        Range("BO1").Select
        ActiveSheet.Paste
        ActiveWindow.ScrollColumn = 58
        ActiveWindow.SmallScroll ToRight:=5
        Sheets("Liste des défauts").Select
        Range("AB17:AC19").Select
        Application.CutCopyMode = False
        Selection.Copy
        Sheets("défaut %").Select
        Range("BV1").Select
        Selection.PasteSpecial Paste:=xlPasteColumnWidths, Operation:=xlNone, _
            SkipBlanks:=False, Transpose:=False
        ActiveSheet.Paste
        Range("BV3").Select
        Application.CutCopyMode = False
        ActiveCell.FormulaR1C1 = "='Liste des défauts'!R[16]C[-46]"
        Range("BW3").Select
        ActiveCell.FormulaR1C1 = "='Liste des défauts'!R[16]C[-46]"
        Range("BV4:BW4").Select
        With Selection
            .HorizontalAlignment = xlCenter
            .VerticalAlignment = xlBottom
            .WrapText = False
            .Orientation = 0
            .AddIndent = False
            .IndentLevel = 0
            .ShrinkToFit = False
            .ReadingOrder = xlContext
            .MergeCells = False
        End With
        Selection.Merge
        ActiveCell.FormulaR1C1 = "=R[-1]C+R[-1]C[1]"
        Range("BO4:BP4").Select
        With Selection
            .HorizontalAlignment = xlCenter
            .VerticalAlignment = xlBottom
            .WrapText = False
            .Orientation = 0
            .AddIndent = False
            .IndentLevel = 0
            .ShrinkToFit = False
            .ReadingOrder = xlContext
            .MergeCells = False
        End With
        Selection.Merge
        ActiveCell.FormulaR1C1 = "=R[-1]C+R[-1]C[1]"
        Range("BO5").Select
        ActiveWindow.SmallScroll ToRight:=-7
        Range("BH4:BI4").Select
        With Selection
            .HorizontalAlignment = xlCenter
            .VerticalAlignment = xlBottom
            .WrapText = False
            .Orientation = 0
            .AddIndent = False
            .IndentLevel = 0
            .ShrinkToFit = False
            .ReadingOrder = xlContext
            .MergeCells = False
        End With
        Selection.Merge
        ActiveCell.FormulaR1C1 = "=R[-1]C+R[-1]C[1]"
        Range("BH5").Select
        ActiveWindow.SmallScroll ToRight:=-13
        Range("BA4:BB4").Select
        With Selection
            .HorizontalAlignment = xlCenter
            .VerticalAlignment = xlBottom
            .WrapText = False
            .Orientation = 0
            .AddIndent = False
            .IndentLevel = 0
            .ShrinkToFit = False
            .ReadingOrder = xlContext
            .MergeCells = False
        End With
        Selection.Merge
        ActiveCell.FormulaR1C1 = "=R[-1]C+R[-1]C[1]"
        Range("AT4:AU4").Select
        With Selection
            .HorizontalAlignment = xlCenter
            .VerticalAlignment = xlBottom
            .WrapText = False
            .Orientation = 0
            .AddIndent = False
            .IndentLevel = 0
            .ShrinkToFit = False
            .ReadingOrder = xlContext
            .MergeCells = False
        End With
        Selection.Merge
        ActiveCell.FormulaR1C1 = "=R[-1]C"
        Range("AT4:AU4").Select
        ActiveCell.FormulaR1C1 = "=R[-1]C+R[-1]C[1]"
        Range("AT5").Select
        ActiveWindow.SmallScroll ToRight:=-11
        Range("AM4:AN4").Select
        With Selection
            .HorizontalAlignment = xlCenter
            .VerticalAlignment = xlBottom
            .WrapText = False
            .Orientation = 0
            .AddIndent = False
            .IndentLevel = 0
            .ShrinkToFit = False
            .ReadingOrder = xlContext
            .MergeCells = False
        End With
        Selection.Merge
        ActiveCell.FormulaR1C1 = "=R[-1]C+R[-1]C[1]"
        Range("AF4:AG4").Select
        With Selection
            .HorizontalAlignment = xlCenter
            .VerticalAlignment = xlBottom
            .WrapText = False
            .Orientation = 0
            .AddIndent = False
            .IndentLevel = 0
            .ShrinkToFit = False
            .ReadingOrder = xlContext
            .MergeCells = False
        End With
        Selection.Merge
        ActiveCell.FormulaR1C1 = "=R[-1]C+R[-1]C[1]"
        Range("AF5").Select
        ActiveWindow.SmallScroll ToRight:=-19
        Range("Y4:Z4").Select
        With Selection
            .HorizontalAlignment = xlCenter
            .VerticalAlignment = xlBottom
            .WrapText = False
            .Orientation = 0
            .AddIndent = False
            .IndentLevel = 0
            .ShrinkToFit = False
            .ReadingOrder = xlContext
            .MergeCells = False
        End With
        Selection.Merge
        ActiveCell.FormulaR1C1 = "=R[-1]C+R[-1]C[1]"
        Range("R4:S4").Select
        With Selection
            .HorizontalAlignment = xlCenter
            .VerticalAlignment = xlBottom
            .WrapText = False
            .Orientation = 0
            .AddIndent = False
            .IndentLevel = 0
            .ShrinkToFit = False
            .ReadingOrder = xlContext
            .MergeCells = False
        End With
        Selection.Merge
        ActiveCell.FormulaR1C1 = "=R[-1]C+R[-1]C[1]"
        Range("R5").Select
        ActiveWindow.SmallScroll ToRight:=-12
        Range("K4:L4").Select
        With Selection
            .HorizontalAlignment = xlCenter
            .VerticalAlignment = xlBottom
            .WrapText = False
            .Orientation = 0
            .AddIndent = False
            .IndentLevel = 0
            .ShrinkToFit = False
            .ReadingOrder = xlContext
            .MergeCells = False
        End With
        Selection.Merge
        ActiveCell.FormulaR1C1 = "=R[-1]C+R[-1]C[1]"
        Range("D4:E4").Select
        With Selection
            .HorizontalAlignment = xlCenter
            .VerticalAlignment = xlBottom
            .WrapText = False
            .Orientation = 0
            .AddIndent = False
            .IndentLevel = 0
            .ShrinkToFit = False
            .ReadingOrder = xlContext
            .MergeCells = False
        End With
        Selection.Merge
        ActiveCell.FormulaR1C1 = "=R[-1]C+R[-1]C[1]"
        Range("D4:E4").Select
        Selection.Borders(xlDiagonalDown).LineStyle = xlNone
        Selection.Borders(xlDiagonalUp).LineStyle = xlNone
        With Selection.Borders(xlEdgeLeft)
            .LineStyle = xlContinuous
            .Weight = xlMedium
            .ColorIndex = xlAutomatic
        End With
        With Selection.Borders(xlEdgeTop)
            .LineStyle = xlContinuous
            .Weight = xlMedium
            .ColorIndex = xlAutomatic
        End With
        With Selection.Borders(xlEdgeBottom)
            .LineStyle = xlContinuous
            .Weight = xlMedium
            .ColorIndex = xlAutomatic
        End With
        With Selection.Borders(xlEdgeRight)
            .LineStyle = xlContinuous
            .Weight = xlMedium
            .ColorIndex = xlAutomatic
        End With
        Selection.Borders(xlInsideVertical).LineStyle = xlNone
        Range("K4:L4").Select
        Selection.Borders(xlDiagonalDown).LineStyle = xlNone
        Selection.Borders(xlDiagonalUp).LineStyle = xlNone
        With Selection.Borders(xlEdgeLeft)
            .LineStyle = xlContinuous
            .Weight = xlMedium
            .ColorIndex = xlAutomatic
        End With
        With Selection.Borders(xlEdgeTop)
            .LineStyle = xlContinuous
            .Weight = xlMedium
            .ColorIndex = xlAutomatic
        End With
        With Selection.Borders(xlEdgeBottom)
            .LineStyle = xlContinuous
            .Weight = xlMedium
            .ColorIndex = xlAutomatic
        End With
        With Selection.Borders(xlEdgeRight)
            .LineStyle = xlContinuous
            .Weight = xlMedium
            .ColorIndex = xlAutomatic
        End With
        Selection.Borders(xlInsideVertical).LineStyle = xlNone
        ActiveWindow.LargeScroll ToRight:=1
        Range("R4:S4").Select
        Selection.Borders(xlDiagonalDown).LineStyle = xlNone
        Selection.Borders(xlDiagonalUp).LineStyle = xlNone
        With Selection.Borders(xlEdgeLeft)
            .LineStyle = xlContinuous
            .Weight = xlMedium
            .ColorIndex = xlAutomatic
        End With
        With Selection.Borders(xlEdgeTop)
            .LineStyle = xlContinuous
            .Weight = xlMedium
            .ColorIndex = xlAutomatic
        End With
        With Selection.Borders(xlEdgeBottom)
            .LineStyle = xlContinuous
            .Weight = xlMedium
            .ColorIndex = xlAutomatic
        End With
        With Selection.Borders(xlEdgeRight)
            .LineStyle = xlContinuous
            .Weight = xlMedium
            .ColorIndex = xlAutomatic
        End With
        Selection.Borders(xlInsideVertical).LineStyle = xlNone
        Range("Y4:Z4").Select
        Selection.Borders(xlDiagonalDown).LineStyle = xlNone
        Selection.Borders(xlDiagonalUp).LineStyle = xlNone
        With Selection.Borders(xlEdgeLeft)
            .LineStyle = xlContinuous
            .Weight = xlMedium
            .ColorIndex = xlAutomatic
        End With
        With Selection.Borders(xlEdgeTop)
            .LineStyle = xlContinuous
            .Weight = xlMedium
            .ColorIndex = xlAutomatic
        End With
        With Selection.Borders(xlEdgeBottom)
            .LineStyle = xlContinuous
            .Weight = xlMedium
            .ColorIndex = xlAutomatic
        End With
        With Selection.Borders(xlEdgeRight)
            .LineStyle = xlContinuous
            .Weight = xlMedium
            .ColorIndex = xlAutomatic
        End With
        Selection.Borders(xlInsideVertical).LineStyle = xlNone
        ActiveWindow.LargeScroll ToRight:=1
        Range("AF4:AG4").Select
        Selection.Borders(xlDiagonalDown).LineStyle = xlNone
        Selection.Borders(xlDiagonalUp).LineStyle = xlNone
        With Selection.Borders(xlEdgeLeft)
            .LineStyle = xlContinuous
            .Weight = xlMedium
            .ColorIndex = xlAutomatic
        End With
        With Selection.Borders(xlEdgeTop)
            .LineStyle = xlContinuous
            .Weight = xlMedium
            .ColorIndex = xlAutomatic
        End With
        With Selection.Borders(xlEdgeBottom)
            .LineStyle = xlContinuous
            .Weight = xlMedium
            .ColorIndex = xlAutomatic
        End With
        With Selection.Borders(xlEdgeRight)
            .LineStyle = xlContinuous
            .Weight = xlMedium
            .ColorIndex = xlAutomatic
        End With
        Selection.Borders(xlInsideVertical).LineStyle = xlNone
        Range("AM4:AN4").Select
        Selection.Borders(xlDiagonalDown).LineStyle = xlNone
        Selection.Borders(xlDiagonalUp).LineStyle = xlNone
        With Selection.Borders(xlEdgeLeft)
            .LineStyle = xlContinuous
            .Weight = xlMedium
            .ColorIndex = xlAutomatic
        End With
        With Selection.Borders(xlEdgeTop)
            .LineStyle = xlContinuous
            .Weight = xlMedium
            .ColorIndex = xlAutomatic
        End With
        With Selection.Borders(xlEdgeBottom)
            .LineStyle = xlContinuous
            .Weight = xlMedium
            .ColorIndex = xlAutomatic
        End With
        With Selection.Borders(xlEdgeRight)
            .LineStyle = xlContinuous
            .Weight = xlMedium
            .ColorIndex = xlAutomatic
        End With
        Selection.Borders(xlInsideVertical).LineStyle = xlNone
        Range("AT4:AU4").Select
        Selection.Borders(xlDiagonalDown).LineStyle = xlNone
        Selection.Borders(xlDiagonalUp).LineStyle = xlNone
        With Selection.Borders(xlEdgeLeft)
            .LineStyle = xlContinuous
            .Weight = xlMedium
            .ColorIndex = xlAutomatic
        End With
        With Selection.Borders(xlEdgeTop)
            .LineStyle = xlContinuous
            .Weight = xlMedium
            .ColorIndex = xlAutomatic
        End With
        With Selection.Borders(xlEdgeBottom)
            .LineStyle = xlContinuous
            .Weight = xlMedium
            .ColorIndex = xlAutomatic
        End With
        With Selection.Borders(xlEdgeRight)
            .LineStyle = xlContinuous
            .Weight = xlMedium
            .ColorIndex = xlAutomatic
        End With
        Selection.Borders(xlInsideVertical).LineStyle = xlNone
        Range("BA4:BB4").Select
        Selection.Borders(xlDiagonalDown).LineStyle = xlNone
        Selection.Borders(xlDiagonalUp).LineStyle = xlNone
        With Selection.Borders(xlEdgeLeft)
            .LineStyle = xlContinuous
            .Weight = xlMedium
            .ColorIndex = xlAutomatic
        End With
        With Selection.Borders(xlEdgeTop)
            .LineStyle = xlContinuous
            .Weight = xlMedium
            .ColorIndex = xlAutomatic
        End With
        With Selection.Borders(xlEdgeBottom)
            .LineStyle = xlContinuous
            .Weight = xlMedium
            .ColorIndex = xlAutomatic
        End With
        With Selection.Borders(xlEdgeRight)
            .LineStyle = xlContinuous
            .Weight = xlMedium
            .ColorIndex = xlAutomatic
        End With
        Selection.Borders(xlInsideVertical).LineStyle = xlNone
        ActiveWindow.LargeScroll ToRight:=1
        Range("BH4:BI4").Select
        Selection.Borders(xlDiagonalDown).LineStyle = xlNone
        Selection.Borders(xlDiagonalUp).LineStyle = xlNone
        With Selection.Borders(xlEdgeLeft)
            .LineStyle = xlContinuous
            .Weight = xlMedium
            .ColorIndex = xlAutomatic
        End With
        With Selection.Borders(xlEdgeTop)
            .LineStyle = xlContinuous
            .Weight = xlMedium
            .ColorIndex = xlAutomatic
        End With
        With Selection.Borders(xlEdgeBottom)
            .LineStyle = xlContinuous
            .Weight = xlMedium
            .ColorIndex = xlAutomatic
        End With
        With Selection.Borders(xlEdgeRight)
            .LineStyle = xlContinuous
            .Weight = xlMedium
            .ColorIndex = xlAutomatic
        End With
        Selection.Borders(xlInsideVertical).LineStyle = xlNone
        Range("BO4:BP4").Select
        Selection.Borders(xlDiagonalDown).LineStyle = xlNone
        Selection.Borders(xlDiagonalUp).LineStyle = xlNone
        With Selection.Borders(xlEdgeLeft)
            .LineStyle = xlContinuous
            .Weight = xlMedium
            .ColorIndex = xlAutomatic
        End With
        With Selection.Borders(xlEdgeTop)
            .LineStyle = xlContinuous
            .Weight = xlMedium
            .ColorIndex = xlAutomatic
        End With
        With Selection.Borders(xlEdgeBottom)
            .LineStyle = xlContinuous
            .Weight = xlMedium
            .ColorIndex = xlAutomatic
        End With
        With Selection.Borders(xlEdgeRight)
            .LineStyle = xlContinuous
            .Weight = xlMedium
            .ColorIndex = xlAutomatic
        End With
        Selection.Borders(xlInsideVertical).LineStyle = xlNone
        ActiveWindow.LargeScroll ToRight:=1
        Range("BV4:BW4").Select
        Selection.Borders(xlDiagonalDown).LineStyle = xlNone
        Selection.Borders(xlDiagonalUp).LineStyle = xlNone
        With Selection.Borders(xlEdgeLeft)
            .LineStyle = xlContinuous
            .Weight = xlMedium
            .ColorIndex = xlAutomatic
        End With
        With Selection.Borders(xlEdgeTop)
            .LineStyle = xlContinuous
            .Weight = xlMedium
            .ColorIndex = xlAutomatic
        End With
        With Selection.Borders(xlEdgeBottom)
            .LineStyle = xlContinuous
            .Weight = xlMedium
            .ColorIndex = xlAutomatic
        End With
        With Selection.Borders(xlEdgeRight)
            .LineStyle = xlContinuous
            .Weight = xlMedium
            .ColorIndex = xlAutomatic
        End With
        Selection.Borders(xlInsideVertical).LineStyle = xlNone
        ActiveWindow.ScrollColumn = 1
     
     
     
     
     
        Range("D4:E4").Select
        Selection.Copy
        Range("D5:D200").Select
        ActiveSheet.Paste
        Range("K4:L4").Select
        Application.CutCopyMode = False
        Selection.Copy
        Range("K5:K200").Select
        ActiveSheet.Paste
        ActiveWindow.SmallScroll ToRight:=12
        Range("R4:S4").Select
        Application.CutCopyMode = False
        Selection.Copy
        Range("R5:R200").Select
        ActiveSheet.Paste
        Range("Y4:Z4").Select
        Application.CutCopyMode = False
        Selection.Copy
        Range("Y5:Y200").Select
        ActiveSheet.Paste
        ActiveWindow.SmallScroll ToRight:=14
        Range("AF4:AG4").Select
        Application.CutCopyMode = False
        Selection.Copy
        Range("AF5:AF200").Select
        ActiveSheet.Paste
        Range("AM4:AN4").Select
        Application.CutCopyMode = False
        Selection.Copy
        Range("AM5:AM200").Select
        ActiveSheet.Paste
        ActiveWindow.SmallScroll ToRight:=13
        Range("AT4:AU4").Select
        Application.CutCopyMode = False
        Selection.Copy
        Range("AT5:AT200").Select
        ActiveSheet.Paste
        Range("BA4:BB4").Select
        Application.CutCopyMode = False
        Selection.Copy
        Range("BA5:BA200").Select
        ActiveSheet.Paste
        ActiveWindow.SmallScroll ToRight:=15
        Range("BH4:BI4").Select
        Application.CutCopyMode = False
        Selection.Copy
        Range("BH5:BH200").Select
        ActiveSheet.Paste
        Range("BO4:BP4").Select
        Application.CutCopyMode = False
        Selection.Copy
        Range("BO5:BO200").Select
        ActiveSheet.Paste
        ActiveWindow.SmallScroll ToRight:=15
        Range("BV4:BW4").Select
        Application.CutCopyMode = False
        Selection.Copy
        Range("BV5:BV200").Select
        ActiveSheet.Paste
        ActiveWindow.LargeScroll ToRight:=-4
        ActiveWindow.ScrollColumn = 1
        Range("C:C,J:J").Select
        Range("J1").Activate
        ActiveWindow.SmallScroll ToRight:=10
        Range("C:C,J:J,Q:Q,X:X").Select
        Range("X1").Activate
        ActiveWindow.SmallScroll ToRight:=14
        Range("C:C,J:J,Q:Q,X:X,AE:AE,AL:AL").Select
        Range("AL1").Activate
        ActiveWindow.SmallScroll ToRight:=14
        Range("C:C,J:J,Q:Q,X:X,AE:AE,AL:AL,AS:AS,AZ:AZ").Select
        Range("AZ1").Activate
        ActiveWindow.SmallScroll ToRight:=15
        Range("C:C,J:J,Q:Q,X:X,AE:AE,AL:AL,AS:AS,AZ:AZ,BG:BG,BN:BN").Select
        Range("BN1").Activate
        ActiveWindow.SmallScroll ToRight:=8
        Range("C:C,J:J,Q:Q,X:X,AE:AE,AL:AL,AS:AS,AZ:AZ,BG:BG,BN:BN,BU:BU").Select
        Range("BU1").Activate
        Application.CutCopyMode = False
        Selection.NumberFormat = "0.00%"
        ActiveWindow.ScrollColumn = 1
        Range("C5").Select
        ActiveCell.FormulaR1C1 = "=IF((RC[-1]/RC[1])>0,(RC[-1]/RC[1]),"""")"
        Range("C5").Select
        Selection.AutoFill Destination:=Range("C5:C200"), Type:=xlFillDefault
        Range("C5:C200").Select
        ActiveWindow.ScrollRow = 1
        Range("J5").Select
        ActiveCell.FormulaR1C1 = "=IF((RC[-1]/RC[1])>0,(RC[-1]/RC[1]),"""")"
        Range("J5").Select
        Selection.AutoFill Destination:=Range("J5:J200"), Type:=xlFillDefault
        Range("J5:J200").Select
        ActiveWindow.ScrollRow = 1
        ActiveWindow.SmallScroll ToRight:=11
        Range("Q5").Select
        ActiveCell.FormulaR1C1 = "=IF((RC[-1]/RC[1])>0,(RC[-1]/RC[1]),"""")"
        Range("Q5").Select
        Selection.AutoFill Destination:=Range("Q5:Q200"), Type:=xlFillDefault
        Range("Q5:Q200").Select
        ActiveWindow.ScrollRow = 1
        Range("X5").Select
        ActiveCell.FormulaR1C1 = "=IF((RC[-1]/RC[1])>0,(RC[-1]/RC[1]),"""")"
        Range("X5").Select
        Selection.AutoFill Destination:=Range("X5:X200"), Type:=xlFillDefault
        Range("X5:X200").Select
        ActiveWindow.SmallScroll ToRight:=15
        ActiveWindow.ScrollRow = 1
        Range("AE5").Select
        ActiveCell.FormulaR1C1 = "=IF((RC[-1]/RC[1])>0,(RC[-1]/RC[1]),"""")"
        Range("AE5").Select
        Selection.AutoFill Destination:=Range("AE5:AE200"), Type:=xlFillDefault
        Range("AE5:AE200").Select
        ActiveWindow.ScrollRow = 1
        Range("AL5").Select
        ActiveCell.FormulaR1C1 = "=IF((RC[-1]/RC[1])>0,(RC[-1]/RC[1]),"""")"
        Range("AL5").Select
        Selection.AutoFill Destination:=Range("AL5:AL200"), Type:=xlFillDefault
        Range("AL5:AL200").Select
        ActiveWindow.ScrollRow = 1
        ActiveWindow.SmallScroll ToRight:=14
        Range("AS5").Select
        ActiveCell.FormulaR1C1 = "=IF((RC[-1]/RC[1])>0,(RC[-1]/RC[1]),"""")"
        Range("AS5").Select
        Selection.AutoFill Destination:=Range("AS5:AS200"), Type:=xlFillDefault
        Range("AS5:AS200").Select
        ActiveWindow.ScrollRow = 1
        Range("AZ5").Select
        ActiveCell.FormulaR1C1 = "=IF((RC[-1]/RC[1])>0,(RC[-1]/RC[1]),"""")"
        Range("AZ5").Select
        Selection.AutoFill Destination:=Range("AZ5:AZ200"), Type:=xlFillDefault
        Range("AZ5:AZ200").Select
        ActiveWindow.SmallScroll ToRight:=14
        ActiveWindow.ScrollRow = 1
        Range("BG5").Select
        ActiveCell.FormulaR1C1 = "=IF((RC[-1]/RC[1])>0,(RC[-1]/RC[1]),"""")"
        Range("BG5").Select
        Selection.AutoFill Destination:=Range("BG5:BG200"), Type:=xlFillDefault
        Range("BG5:BG200").Select
        ActiveWindow.ScrollRow = 1
        Range("BN5").Select
        ActiveCell.FormulaR1C1 = "=IF((RC[-1]/RC[1])>0,(RC[-1]/RC[1]),"""")"
        Range("BN5").Select
        Selection.AutoFill Destination:=Range("BN5:BN200"), Type:=xlFillDefault
        Range("BN5:BN200").Select
        ActiveWindow.ScrollRow = 1
        ActiveWindow.SmallScroll ToRight:=10
        Range("BU5").Select
        ActiveCell.FormulaR1C1 = "=IF((RC[-1]/RC[1])>0,(RC[-1]/RC[1]),"""")"
        Range("BU5").Select
        Selection.AutoFill Destination:=Range("BU5:BU200"), Type:=xlFillDefault
        Range("BU5:BU200").Select
        ActiveWindow.SmallScroll Down:=-78
        ActiveWindow.LargeScroll Down:=-1
        ActiveWindow.ScrollRow = 19
        ActiveWindow.SmallScroll Down:=-18
     
    End Sub

  8. #8
    Membre Expert
    Avatar de JackOuYA
    Inscrit en
    Juin 2008
    Messages
    1 040
    Détails du profil
    Informations forums :
    Inscription : Juin 2008
    Messages : 1 040
    Par défaut
    Citation Envoyé par maguetlolo Voir le message
    Voici une des macro, il est certain que ca va
    horrifier ceux qui vont la lire!!!
    ....
    Bonjour,

    oui c'est vraiment du brut de d'enregistreur... tout ces "Select" sont des ralentisseurs de code ..
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
       Sheets("R01").Select
        Columns("A:B").Select
        Selection.Copy
    peu s'écrire :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
       Sheets("R01").Columns("A:B").Copy
    (et encore moi je préciserai le classeur..)


    où bien mieux s'en changer de feuille active


    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    Sheets("Liste des défauts").Select
        Range("V17:W19").Select
        Application.CutCopyMode = False
        Selection.Copy
        Sheets("défaut %").Select
        Range("BA1").Select
        ActiveSheet.Paste
    devient
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    Sheets("défaut %").Range("BA1:BB3")  = Sheets("Liste des défauts").Range("V17:W19").value




    tu peu facilement supprimer tous tes
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    ActiveWindow.SmallScroll
    (un coup de :F1: sur SmallScroll te permettra de connaître l'utilisation de cette fonction.)




    Bon courage




    JacqueS.

  9. #9
    Membre averti
    Profil pro
    Inscrit en
    Juin 2008
    Messages
    30
    Détails du profil
    Informations personnelles :
    Âge : 53
    Localisation : France

    Informations forums :
    Inscription : Juin 2008
    Messages : 30
    Par défaut
    bonjour JackOuYA

    oui, du boulot en perspective, merci pour tes infos , c'est avec ca que j'arriverais a progresser, pour le classeur, je peut pas le nommer car il change de nom tout les mois et porte le nom de ceux-ci

  10. #10
    Membre Expert
    Avatar de JackOuYA
    Inscrit en
    Juin 2008
    Messages
    1 040
    Détails du profil
    Informations forums :
    Inscription : Juin 2008
    Messages : 1 040
    Par défaut
    Et le code il est ou dans un autre classeur ..?
    tu l'ouvre comment le classeur à modifier ?

  11. #11
    Membre averti
    Profil pro
    Inscrit en
    Juin 2008
    Messages
    30
    Détails du profil
    Informations personnelles :
    Âge : 53
    Localisation : France

    Informations forums :
    Inscription : Juin 2008
    Messages : 30
    Par défaut
    tu parle du code qui nomme mon classeur? non, je le nomme moi même manuellement, en fait j'ai copié 12 fois le même classeur en les nommant de janvier a décembre. mais comme qui dirait, c "en cours de construction"
    alors ya plein de détail que je voit au fur et a mesure.

    dis moi, j'ai voulu remplacer ca :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    Range("BV3").Select
    Application.CutCopyMode = False
    par ça : je peut pas, c pas bon?

  12. #12
    Membre Expert
    Avatar de JackOuYA
    Inscrit en
    Juin 2008
    Messages
    1 040
    Détails du profil
    Informations forums :
    Inscription : Juin 2008
    Messages : 1 040
    Par défaut
    non c'est pas bon ..

    Range("BV3").Select sélectionne cellule BV3
    Application.CutCopyMode = False abandonne copie/coller en cours (l'équivalent d'une action sur la touche échappe, aprés un copier ou un couper) ..

    s'il s'agit de ce morceau de code
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
     
    ActiveSheet.Paste
        Range("BV3").Select
        Application.CutCopyMode = False
        ActiveCell.FormulaR1C1 = "='Liste des défauts'!R[16]C[-46]"
        Range("BW3").Select
        ActiveCell.FormulaR1C1 = "='Liste des défauts'!R[16]C[-46]"
        Range("BV4:BW4").Select
    tu peu écrire
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    ActiveSheet.Paste 'Colle l'élément précédament copier 
          Application.CutCopyMode = False ' Fin du copier/coller
     
     
        Range("BV3").FormulaR1C1 = "='Liste des défauts'!R[16]C[-46]"
        Range("BW3").FormulaR1C1 = "='Liste des défauts'!R[16]C[-46]"..
    mais comme vu plus haut, je supprimerai bien aussi tes actions
    CelluleSource.copy
    CelluleDestination.Paste
    CupCopyMode..'fin de copie.
    par
    CelluleDestination = CelluleSource


    JacqueS.

  13. #13
    Membre averti
    Profil pro
    Inscrit en
    Juin 2008
    Messages
    30
    Détails du profil
    Informations personnelles :
    Âge : 53
    Localisation : France

    Informations forums :
    Inscription : Juin 2008
    Messages : 30
    Par défaut
    oui, je vais faire ca dans l'ordre afin de comprendre ce que je fait
    car mine de rien j'ai une petite vingtaine de macro dans ce style la dans mon classeur

    re: un petit soucis, j'ai fait les changement mais maintenant, la macro se bloque et quand je fait echap j'en suis là : Range("C:C,J:J").Select
    coloré aussi dans le code. je trouve pas .


    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    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
        Application.ScreenUpdating = False
        Sheets.Add
        ActiveSheet.Select
        ActiveSheet.Move After:=Sheets(28)
        ActiveSheet.Name = "défaut %"
        Sheets("R01").Columns("A:B").Copy
        Sheets("défaut %").Select
        Columns("A:A").Select
        Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
            :=False, Transpose:=False
        Sheets("R02").Columns("A:B").Copy
        Sheets("défaut %").Select
        Columns("H:H").Select
        Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
            :=False, Transpose:=False
        Sheets("R03").Columns("A:B").Copy
        Sheets("défaut %").Select
        Columns("O:O").Select
        Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
            :=False, Transpose:=False
        Sheets("R04").Columns("A:B").Copy
        Sheets("défaut %").Select
        Columns("V:V").Select
        Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
            :=False, Transpose:=False
        Sheets("R05").Columns("A:B").Copy
        Sheets("défaut %").Select
        Columns("AC:AC").Select
        Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
            :=False, Transpose:=False
        Sheets("R06").Columns("A:B").Copy
        Sheets("défaut %").Select
        Columns("AJ:AJ").Select
        Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
            :=False, Transpose:=False
        Sheets("R07").Columns("A:B").Copy
        Sheets("défaut %").Select
        Columns("AQ:AQ").Select
        Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
            :=False, Transpose:=False
        Sheets("R08").Columns("A:B").Copy
        Sheets("défaut %").Select
        Columns("AX:AX").Select
        Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
            :=False, Transpose:=False
        Sheets("R09").Columns("A:B").Copy
        Sheets("défaut %").Select
        Columns("BE:BE").Select
        Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
            :=False, Transpose:=False
            Sheets("R10").Columns("A:B").Copy
        Sheets("défaut %").Select
        Columns("BL:BL").Select
        Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
            :=False, Transpose:=False
        
        Sheets("défaut %").Columns("BS:BS") = Sheets("Total nbre défaut tout TK").Columns("A:B").Value
        
        
        Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
            :=False, Transpose:=False
       
        Sheets("défaut %").Range("D1:E3") = Sheets("Liste des défauts").Range("H17:I19").Value
        Sheets("défaut %").Range("K1:L3") = Sheets("Liste des défauts").Range("J17:K19").Value
        Sheets("défaut %").Range("R1:S3") = Sheets("Liste des défauts").Range("L17:M19").Value
        Sheets("défaut %").Range("Y1:Z3") = Sheets("Liste des défauts").Range("N17:O19").Value
        Sheets("défaut %").Range("AF1:AG3") = Sheets("Liste des défauts").Range("P17:Q19").Value
        Sheets("défaut %").Range("AM1:AN3") = Sheets("Liste des défauts").Range("R17:S19").Value
        Sheets("défaut %").Range("AT1:AU3") = Sheets("Liste des défauts").Range("T17:U19").Value
        Sheets("défaut %").Range("BA1:BB3") = Sheets("Liste des défauts").Range("V17:W19").Value
        Sheets("défaut %").Range("BH1:BI3") = Sheets("Liste des défauts").Range("X17:Y19").Value
        Sheets("défaut %").Range("BO1:BP3") = Sheets("Liste des défauts").Range("Z17:AA19").Value
        Sheets("défaut %").Range("BV1:BW3") = Sheets("Liste des défauts").Range("AB17:AC19").Value
        
        
        Range("BV3").Copy
        ActiveCell.FormulaR1C1 = "='Liste des défauts'!R[16]C[-46]"
        Range("BW3").Select
        ActiveCell.FormulaR1C1 = "='Liste des défauts'!R[16]C[-46]"
        Range("BV4:BW4").Select
        With Selection
            .HorizontalAlignment = xlCenter
            .VerticalAlignment = xlBottom
            .WrapText = False
            .Orientation = 0
            .AddIndent = False
            .IndentLevel = 0
            .ShrinkToFit = False
            .ReadingOrder = xlContext
            .MergeCells = False
        End With
        Selection.Merge
        ActiveCell.FormulaR1C1 = "=R[-1]C+R[-1]C[1]"
        Range("BO4:BP4").Select
        With Selection
            .HorizontalAlignment = xlCenter
            .VerticalAlignment = xlBottom
            .WrapText = False
            .Orientation = 0
            .AddIndent = False
            .IndentLevel = 0
            .ShrinkToFit = False
            .ReadingOrder = xlContext
            .MergeCells = False
        End With
        Selection.Merge
        ActiveCell.FormulaR1C1 = "=R[-1]C+R[-1]C[1]"
        
        Range("BH4:BI4").Select
        With Selection
            .HorizontalAlignment = xlCenter
            .VerticalAlignment = xlBottom
            .WrapText = False
            .Orientation = 0
            .AddIndent = False
            .IndentLevel = 0
            .ShrinkToFit = False
            .ReadingOrder = xlContext
            .MergeCells = False
        End With
        Selection.Merge
        ActiveCell.FormulaR1C1 = "=R[-1]C+R[-1]C[1]"
        Range("BH5").Select
        
        Range("BA4:BB4").Select
        With Selection
            .HorizontalAlignment = xlCenter
            .VerticalAlignment = xlBottom
            .WrapText = False
            .Orientation = 0
            .AddIndent = False
            .IndentLevel = 0
            .ShrinkToFit = False
            .ReadingOrder = xlContext
            .MergeCells = False
        End With
        Selection.Merge
        ActiveCell.FormulaR1C1 = "=R[-1]C+R[-1]C[1]"
        Range("AT4:AU4").Select
        With Selection
            .HorizontalAlignment = xlCenter
            .VerticalAlignment = xlBottom
            .WrapText = False
            .Orientation = 0
            .AddIndent = False
            .IndentLevel = 0
            .ShrinkToFit = False
            .ReadingOrder = xlContext
            .MergeCells = False
        End With
        Selection.Merge
        ActiveCell.FormulaR1C1 = "=R[-1]C"
        Range("AT4:AU4").Select
        ActiveCell.FormulaR1C1 = "=R[-1]C+R[-1]C[1]"
        Range("AT5").Select
        
        Range("AM4:AN4").Select
        With Selection
            .HorizontalAlignment = xlCenter
            .VerticalAlignment = xlBottom
            .WrapText = False
            .Orientation = 0
            .AddIndent = False
            .IndentLevel = 0
            .ShrinkToFit = False
            .ReadingOrder = xlContext
            .MergeCells = False
        End With
        Selection.Merge
        ActiveCell.FormulaR1C1 = "=R[-1]C+R[-1]C[1]"
        Range("AF4:AG4").Select
        With Selection
            .HorizontalAlignment = xlCenter
            .VerticalAlignment = xlBottom
            .WrapText = False
            .Orientation = 0
            .AddIndent = False
            .IndentLevel = 0
            .ShrinkToFit = False
            .ReadingOrder = xlContext
            .MergeCells = False
        End With
        Selection.Merge
        ActiveCell.FormulaR1C1 = "=R[-1]C+R[-1]C[1]"
        Range("AF5").Select
        
        Range("Y4:Z4").Select
        With Selection
            .HorizontalAlignment = xlCenter
            .VerticalAlignment = xlBottom
            .WrapText = False
            .Orientation = 0
            .AddIndent = False
            .IndentLevel = 0
            .ShrinkToFit = False
            .ReadingOrder = xlContext
            .MergeCells = False
        End With
        Selection.Merge
        ActiveCell.FormulaR1C1 = "=R[-1]C+R[-1]C[1]"
        Range("R4:S4").Select
        With Selection
            .HorizontalAlignment = xlCenter
            .VerticalAlignment = xlBottom
            .WrapText = False
            .Orientation = 0
            .AddIndent = False
            .IndentLevel = 0
            .ShrinkToFit = False
            .ReadingOrder = xlContext
            .MergeCells = False
        End With
        Selection.Merge
        ActiveCell.FormulaR1C1 = "=R[-1]C+R[-1]C[1]"
        Range("R5").Select
        
        Range("K4:L4").Select
        With Selection
            .HorizontalAlignment = xlCenter
            .VerticalAlignment = xlBottom
            .WrapText = False
            .Orientation = 0
            .AddIndent = False
            .IndentLevel = 0
            .ShrinkToFit = False
            .ReadingOrder = xlContext
            .MergeCells = False
        End With
        Selection.Merge
        ActiveCell.FormulaR1C1 = "=R[-1]C+R[-1]C[1]"
        Range("D4:E4").Select
        With Selection
            .HorizontalAlignment = xlCenter
            .VerticalAlignment = xlBottom
            .WrapText = False
            .Orientation = 0
            .AddIndent = False
            .IndentLevel = 0
            .ShrinkToFit = False
            .ReadingOrder = xlContext
            .MergeCells = False
        End With
        Selection.Merge
        ActiveCell.FormulaR1C1 = "=R[-1]C+R[-1]C[1]"
        Range("D4:E4").Select
        Selection.Borders(xlDiagonalDown).LineStyle = xlNone
        Selection.Borders(xlDiagonalUp).LineStyle = xlNone
        With Selection.Borders(xlEdgeLeft)
            .LineStyle = xlContinuous
            .Weight = xlMedium
            .ColorIndex = xlAutomatic
        End With
        With Selection.Borders(xlEdgeTop)
            .LineStyle = xlContinuous
            .Weight = xlMedium
            .ColorIndex = xlAutomatic
        End With
        With Selection.Borders(xlEdgeBottom)
            .LineStyle = xlContinuous
            .Weight = xlMedium
            .ColorIndex = xlAutomatic
        End With
        With Selection.Borders(xlEdgeRight)
            .LineStyle = xlContinuous
            .Weight = xlMedium
            .ColorIndex = xlAutomatic
        End With
        Selection.Borders(xlInsideVertical).LineStyle = xlNone
        Range("K4:L4").Select
        Selection.Borders(xlDiagonalDown).LineStyle = xlNone
        Selection.Borders(xlDiagonalUp).LineStyle = xlNone
        With Selection.Borders(xlEdgeLeft)
            .LineStyle = xlContinuous
            .Weight = xlMedium
            .ColorIndex = xlAutomatic
        End With
        With Selection.Borders(xlEdgeTop)
            .LineStyle = xlContinuous
            .Weight = xlMedium
            .ColorIndex = xlAutomatic
        End With
        With Selection.Borders(xlEdgeBottom)
            .LineStyle = xlContinuous
            .Weight = xlMedium
            .ColorIndex = xlAutomatic
        End With
        With Selection.Borders(xlEdgeRight)
            .LineStyle = xlContinuous
            .Weight = xlMedium
            .ColorIndex = xlAutomatic
        End With
        Selection.Borders(xlInsideVertical).LineStyle = xlNone
        
        Range("R4:S4").Select
        Selection.Borders(xlDiagonalDown).LineStyle = xlNone
        Selection.Borders(xlDiagonalUp).LineStyle = xlNone
        With Selection.Borders(xlEdgeLeft)
            .LineStyle = xlContinuous
            .Weight = xlMedium
            .ColorIndex = xlAutomatic
        End With
        With Selection.Borders(xlEdgeTop)
            .LineStyle = xlContinuous
            .Weight = xlMedium
            .ColorIndex = xlAutomatic
        End With
        With Selection.Borders(xlEdgeBottom)
            .LineStyle = xlContinuous
            .Weight = xlMedium
            .ColorIndex = xlAutomatic
        End With
        With Selection.Borders(xlEdgeRight)
            .LineStyle = xlContinuous
            .Weight = xlMedium
            .ColorIndex = xlAutomatic
        End With
        Selection.Borders(xlInsideVertical).LineStyle = xlNone
        Range("Y4:Z4").Select
        Selection.Borders(xlDiagonalDown).LineStyle = xlNone
        Selection.Borders(xlDiagonalUp).LineStyle = xlNone
        With Selection.Borders(xlEdgeLeft)
            .LineStyle = xlContinuous
            .Weight = xlMedium
            .ColorIndex = xlAutomatic
        End With
        With Selection.Borders(xlEdgeTop)
            .LineStyle = xlContinuous
            .Weight = xlMedium
            .ColorIndex = xlAutomatic
        End With
        With Selection.Borders(xlEdgeBottom)
            .LineStyle = xlContinuous
            .Weight = xlMedium
            .ColorIndex = xlAutomatic
        End With
        With Selection.Borders(xlEdgeRight)
            .LineStyle = xlContinuous
            .Weight = xlMedium
            .ColorIndex = xlAutomatic
        End With
        Selection.Borders(xlInsideVertical).LineStyle = xlNone
        
        Range("AF4:AG4").Select
        Selection.Borders(xlDiagonalDown).LineStyle = xlNone
        Selection.Borders(xlDiagonalUp).LineStyle = xlNone
        With Selection.Borders(xlEdgeLeft)
            .LineStyle = xlContinuous
            .Weight = xlMedium
            .ColorIndex = xlAutomatic
        End With
        With Selection.Borders(xlEdgeTop)
            .LineStyle = xlContinuous
            .Weight = xlMedium
            .ColorIndex = xlAutomatic
        End With
        With Selection.Borders(xlEdgeBottom)
            .LineStyle = xlContinuous
            .Weight = xlMedium
            .ColorIndex = xlAutomatic
        End With
        With Selection.Borders(xlEdgeRight)
            .LineStyle = xlContinuous
            .Weight = xlMedium
            .ColorIndex = xlAutomatic
        End With
        Selection.Borders(xlInsideVertical).LineStyle = xlNone
        Range("AM4:AN4").Select
        Selection.Borders(xlDiagonalDown).LineStyle = xlNone
        Selection.Borders(xlDiagonalUp).LineStyle = xlNone
        With Selection.Borders(xlEdgeLeft)
            .LineStyle = xlContinuous
            .Weight = xlMedium
            .ColorIndex = xlAutomatic
        End With
        With Selection.Borders(xlEdgeTop)
            .LineStyle = xlContinuous
            .Weight = xlMedium
            .ColorIndex = xlAutomatic
        End With
        With Selection.Borders(xlEdgeBottom)
            .LineStyle = xlContinuous
            .Weight = xlMedium
            .ColorIndex = xlAutomatic
        End With
        With Selection.Borders(xlEdgeRight)
            .LineStyle = xlContinuous
            .Weight = xlMedium
            .ColorIndex = xlAutomatic
        End With
        Selection.Borders(xlInsideVertical).LineStyle = xlNone
        Range("AT4:AU4").Select
        Selection.Borders(xlDiagonalDown).LineStyle = xlNone
        Selection.Borders(xlDiagonalUp).LineStyle = xlNone
        With Selection.Borders(xlEdgeLeft)
            .LineStyle = xlContinuous
            .Weight = xlMedium
            .ColorIndex = xlAutomatic
        End With
        With Selection.Borders(xlEdgeTop)
            .LineStyle = xlContinuous
            .Weight = xlMedium
            .ColorIndex = xlAutomatic
        End With
        With Selection.Borders(xlEdgeBottom)
            .LineStyle = xlContinuous
            .Weight = xlMedium
            .ColorIndex = xlAutomatic
        End With
        With Selection.Borders(xlEdgeRight)
            .LineStyle = xlContinuous
            .Weight = xlMedium
            .ColorIndex = xlAutomatic
        End With
        Selection.Borders(xlInsideVertical).LineStyle = xlNone
        Range("BA4:BB4").Select
        Selection.Borders(xlDiagonalDown).LineStyle = xlNone
        Selection.Borders(xlDiagonalUp).LineStyle = xlNone
        With Selection.Borders(xlEdgeLeft)
            .LineStyle = xlContinuous
            .Weight = xlMedium
            .ColorIndex = xlAutomatic
        End With
        With Selection.Borders(xlEdgeTop)
            .LineStyle = xlContinuous
            .Weight = xlMedium
            .ColorIndex = xlAutomatic
        End With
        With Selection.Borders(xlEdgeBottom)
            .LineStyle = xlContinuous
            .Weight = xlMedium
            .ColorIndex = xlAutomatic
        End With
        With Selection.Borders(xlEdgeRight)
            .LineStyle = xlContinuous
            .Weight = xlMedium
            .ColorIndex = xlAutomatic
        End With
        Selection.Borders(xlInsideVertical).LineStyle = xlNone
        
        Range("BH4:BI4").Select
        Selection.Borders(xlDiagonalDown).LineStyle = xlNone
        Selection.Borders(xlDiagonalUp).LineStyle = xlNone
        With Selection.Borders(xlEdgeLeft)
            .LineStyle = xlContinuous
            .Weight = xlMedium
            .ColorIndex = xlAutomatic
        End With
        With Selection.Borders(xlEdgeTop)
            .LineStyle = xlContinuous
            .Weight = xlMedium
            .ColorIndex = xlAutomatic
        End With
        With Selection.Borders(xlEdgeBottom)
            .LineStyle = xlContinuous
            .Weight = xlMedium
            .ColorIndex = xlAutomatic
        End With
        With Selection.Borders(xlEdgeRight)
            .LineStyle = xlContinuous
            .Weight = xlMedium
            .ColorIndex = xlAutomatic
        End With
        Selection.Borders(xlInsideVertical).LineStyle = xlNone
        Range("BO4:BP4").Select
        Selection.Borders(xlDiagonalDown).LineStyle = xlNone
        Selection.Borders(xlDiagonalUp).LineStyle = xlNone
        With Selection.Borders(xlEdgeLeft)
            .LineStyle = xlContinuous
            .Weight = xlMedium
            .ColorIndex = xlAutomatic
        End With
        With Selection.Borders(xlEdgeTop)
            .LineStyle = xlContinuous
            .Weight = xlMedium
            .ColorIndex = xlAutomatic
        End With
        With Selection.Borders(xlEdgeBottom)
            .LineStyle = xlContinuous
            .Weight = xlMedium
            .ColorIndex = xlAutomatic
        End With
        With Selection.Borders(xlEdgeRight)
            .LineStyle = xlContinuous
            .Weight = xlMedium
            .ColorIndex = xlAutomatic
        End With
        Selection.Borders(xlInsideVertical).LineStyle = xlNone
        
        Range("BV4:BW4").Select
        Selection.Borders(xlDiagonalDown).LineStyle = xlNone
        Selection.Borders(xlDiagonalUp).LineStyle = xlNone
        With Selection.Borders(xlEdgeLeft)
            .LineStyle = xlContinuous
            .Weight = xlMedium
            .ColorIndex = xlAutomatic
        End With
        With Selection.Borders(xlEdgeTop)
            .LineStyle = xlContinuous
            .Weight = xlMedium
            .ColorIndex = xlAutomatic
        End With
        With Selection.Borders(xlEdgeBottom)
            .LineStyle = xlContinuous
            .Weight = xlMedium
            .ColorIndex = xlAutomatic
        End With
        With Selection.Borders(xlEdgeRight)
            .LineStyle = xlContinuous
            .Weight = xlMedium
            .ColorIndex = xlAutomatic
        End With
        Selection.Borders(xlInsideVertical).LineStyle = xlNone
       
        
        Range("D5:D200") = Range("D4:E4").Value
        
        Range("K5:K200") = Range("K4:L4").Value
        
        Range("R5:R200") = Range("R4:S4").Value
        
        Range("Y5:Y200") = Range("Y4:Z4").Value
        
        Range("AF5:AF200") = Range("AF4:AG4").Value
        
        Range("AM5:AM200") = Range("AM4:AN4").Value
       
        Range("AT5:AT200") = Range("AT4:AU4").Value
        
        Range("BA5:BA200") = Range("BA4:BB4").Value
        
        Range("BH5:BH200") = Range("BH4:BI4").Value
        
        Range("BO5:BO200") = Range("BO4:BP4").Value
        
        Range("BV5:BV200") = Range("BV4:BW4").Value
        Range("C:C,J:J").Select
        Range("J1").Activate
        Range("C:C,J:J,Q:Q,X:X").Select
        Range("X1").Activate
        Range("C:C,J:J,Q:Q,X:X,AE:AE,AL:AL").Select
        Range("AL1").Activate
        Range("C:C,J:J,Q:Q,X:X,AE:AE,AL:AL,AS:AS,AZ:AZ").Select
        Range("AZ1").Activate
        Range("C:C,J:J,Q:Q,X:X,AE:AE,AL:AL,AS:AS,AZ:AZ,BG:BG,BN:BN").Select
        Range("BN1").Activate
        Range("C:C,J:J,Q:Q,X:X,AE:AE,AL:AL,AS:AS,AZ:AZ,BG:BG,BN:BN,BU:BU").Select
        Range("BU1").Activate
        Application.CutCopyMode = False
        Selection.NumberFormat = "0.00%"
       
        Range("C5").Select
        ActiveCell.FormulaR1C1 = "=IF((RC[-1]/RC[1])>0,(RC[-1]/RC[1]),"""")"
        Range("C5").Select
        Selection.AutoFill Destination:=Range("C5:C200"), Type:=xlFillDefault
        Range("C5:C200").Select
        
        Range("J5").Select
        ActiveCell.FormulaR1C1 = "=IF((RC[-1]/RC[1])>0,(RC[-1]/RC[1]),"""")"
        Range("J5").Select
        Selection.AutoFill Destination:=Range("J5:J200"), Type:=xlFillDefault
        Range("J5:J200").Select
        
        Range("Q5").Select
        ActiveCell.FormulaR1C1 = "=IF((RC[-1]/RC[1])>0,(RC[-1]/RC[1]),"""")"
        Range("Q5").Select
        Selection.AutoFill Destination:=Range("Q5:Q200"), Type:=xlFillDefault
        Range("Q5:Q200").Select
        
        Range("X5").Select
        ActiveCell.FormulaR1C1 = "=IF((RC[-1]/RC[1])>0,(RC[-1]/RC[1]),"""")"
        Range("X5").Select
        Selection.AutoFill Destination:=Range("X5:X200"), Type:=xlFillDefault
        Range("X5:X200").Select
       
        Range("AE5").Select
        ActiveCell.FormulaR1C1 = "=IF((RC[-1]/RC[1])>0,(RC[-1]/RC[1]),"""")"
        Range("AE5").Select
        Selection.AutoFill Destination:=Range("AE5:AE200"), Type:=xlFillDefault
        Range("AE5:AE200").Select
        
        Range("AL5").Select
        ActiveCell.FormulaR1C1 = "=IF((RC[-1]/RC[1])>0,(RC[-1]/RC[1]),"""")"
        Range("AL5").Select
        Selection.AutoFill Destination:=Range("AL5:AL200"), Type:=xlFillDefault
        Range("AL5:AL200").Select
       
        Range("AS5").Select
        ActiveCell.FormulaR1C1 = "=IF((RC[-1]/RC[1])>0,(RC[-1]/RC[1]),"""")"
        Range("AS5").Select
        Selection.AutoFill Destination:=Range("AS5:AS200"), Type:=xlFillDefault
        Range("AS5:AS200").Select
        
        Range("AZ5").Select
        ActiveCell.FormulaR1C1 = "=IF((RC[-1]/RC[1])>0,(RC[-1]/RC[1]),"""")"
        Range("AZ5").Select
        Selection.AutoFill Destination:=Range("AZ5:AZ200"), Type:=xlFillDefault
        Range("AZ5:AZ200").Select
       
        Range("BG5").Select
        ActiveCell.FormulaR1C1 = "=IF((RC[-1]/RC[1])>0,(RC[-1]/RC[1]),"""")"
        Range("BG5").Select
        Selection.AutoFill Destination:=Range("BG5:BG200"), Type:=xlFillDefault
        Range("BG5:BG200").Select
        
        Range("BN5").Select
        ActiveCell.FormulaR1C1 = "=IF((RC[-1]/RC[1])>0,(RC[-1]/RC[1]),"""")"
        Range("BN5").Select
        Selection.AutoFill Destination:=Range("BN5:BN200"), Type:=xlFillDefault
        Range("BN5:BN200").Select
        
        Range("BU5").Select
        ActiveCell.FormulaR1C1 = "=IF((RC[-1]/RC[1])>0,(RC[-1]/RC[1]),"""")"
        Range("BU5").Select
        Selection.AutoFill Destination:=Range("BU5:BU200"), Type:=xlFillDefault
        Range("BU5:BU200").Select
        
        
    End Sub

  14. #14
    Membre Expert
    Avatar de JackOuYA
    Inscrit en
    Juin 2008
    Messages
    1 040
    Détails du profil
    Informations forums :
    Inscription : Juin 2008
    Messages : 1 040
    Par défaut
    toutes cette série de select sucesssif semble correspondre à un changement de fomat des colonnes sélectionnées !
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
     
    Sheets("NomDeLaFeuille).Range("C:C,J:J,Q:Q,X:X,AE:AE,AL:AL,AS:AS,AZ:AZ,BG:BG,BN:BN,BU:BU").NumberFormat = "0.00%"

    je comprends pas bien ton blocage?

  15. #15
    Membre averti
    Profil pro
    Inscrit en
    Juin 2008
    Messages
    30
    Détails du profil
    Informations personnelles :
    Âge : 53
    Localisation : France

    Informations forums :
    Inscription : Juin 2008
    Messages : 30
    Par défaut
    ben moi non plus
    ce n'est pas grave, j'ai tout ca plus qu'en double.
    je vais la reprendre du début et essayer de comprendre
    j'ai forcement toucher a quelque chose qu'il ne fallait pas, faut bien faire des betises quand on apprends

  16. #16
    Membre Expert
    Avatar de JackOuYA
    Inscrit en
    Juin 2008
    Messages
    1 040
    Détails du profil
    Informations forums :
    Inscription : Juin 2008
    Messages : 1 040
    Par défaut
    Il n'y as pas de message lors de ton blocage ..?

  17. #17
    Membre averti
    Profil pro
    Inscrit en
    Juin 2008
    Messages
    30
    Détails du profil
    Informations personnelles :
    Âge : 53
    Localisation : France

    Informations forums :
    Inscription : Juin 2008
    Messages : 30
    Par défaut
    voila, c résolu, ne me demandez pas ce qu'il y avais, je ne le sait pas moi-même!! (et ca veux faire du VBA!!) bon je continue a bosser sur vos conseil et je vous tiens au courant

    a+

    une petite question, quand on a un classeur avec beaucoup de macro spécifique (elle ne serviront pas pour d'autre classeur), quels sont les avantages et les inconvénients de les placer dans le dossier perso plutot que dans le classeur en question? et si on les place dans le classeur, faut-il les pacer dans des module ou "this workbook", je ne voit pas ce que ca change?
    pouvez-vous m'éclairer a ce sujet? merci

  18. #18
    Membre averti
    Profil pro
    Inscrit en
    Juin 2008
    Messages
    30
    Détails du profil
    Informations personnelles :
    Âge : 53
    Localisation : France

    Informations forums :
    Inscription : Juin 2008
    Messages : 30
    Par défaut
    Bonjour

    Voila, j'ai déja supprimer ou modifier plein de choses suivant vos conseils.
    je tombe maintenant avec des parties avec les quelle je ne sait que faire, voici une de ces parties, pouvez vous me conseiller?


    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    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
    Sheets("TK2").Select
        ActiveWorkbook.PivotCaches.Add(SourceType:=xlDatabase, SourceData:= _
        "$A1:$D1000").CreatePivotTable TableDestination:="", TableName:="Tableau croisé dynamique7", DefaultVersion:=xlPivotTableVersion10
            With ActiveSheet.PivotTables("Tableau croisé dynamique7").PivotFields("TK")
        .Orientation = xlPageField
        .Position = 1
        ActiveSheet.PivotTables("Tableau croisé dynamique7").AddDataField ActiveSheet. _
            PivotTables("Tableau croisé dynamique7").PivotFields("Défaut"), _
            "Nombre de Défaut", xlCount
        End With
        With ActiveSheet.PivotTables("Tableau croisé dynamique7").PivotFields("Défaut")
            .Orientation = xlColumnField
            .Position = 1
        End With
        With ActiveSheet.PivotTables("Tableau croisé dynamique7").PivotFields("Défaut")
            .Orientation = xlRowField
            .Position = 1
                End With
        ActiveSheet.Name = "R02"
     
        Charts.Add
        ActiveChart.ChartType = xlColumnClustered
        ActiveChart.SetSourceData Source:=Sheets("R02").Range("$A1:$B100")
        ActiveChart.Location Where:=xlLocationAsObject, Name:= _
        "Graphiques défauts TK"
     
        With ActiveChart
            .HasTitle = True
            .ChartTitle.Characters.Text = "Nombre de défauts TK2"
            .Axes(xlCategory, xlPrimary).HasTitle = False
            .Axes(xlValue, xlPrimary).HasTitle = False
                ActiveChart.ChartArea.Select
         ActiveChart.HasPivotFields = False
         ActiveChart.Legend.Select
        Selection.Delete
         ActiveChart.SeriesCollection(1).Select
        ActiveChart.ChartArea.Select
        ActiveChart.ApplyDataLabels AutoText:=True, LegendKey:=False, _
            HasLeaderLines:=False, ShowSeriesName:=False, ShowCategoryName:=False, _
            ShowValue:=True, ShowPercentage:=False, ShowBubbleSize:=False
        ActiveSheet.Shapes("Graphique 2").IncrementLeft -226.5
        ActiveSheet.Shapes("Graphique 2").IncrementTop -89.25
        End With
     
        ActiveChart.PlotArea.Select
        With Selection.Border
            .ColorIndex = 2
            .Weight = xlThin
            .LineStyle = xlContinuous
        End With
        With Selection.Interior
            .ColorIndex = 2
            .PatternColorIndex = 1
            .Pattern = xlSolid
        End With
        ActiveChart.Axes(xlValue).Select
        With ActiveChart.Axes(xlValue)
            .MinimumScaleIsAuto = True
            .MaximumScale = 120
            .MinorUnitIsAuto = True
            .MajorUnit = 20
            .Crosses = xlAutomatic
            .ReversePlotOrder = False
            .ScaleType = xlLinear
            .DisplayUnit = xlNone
        End With
     
     
        With ActiveSheet.Shapes("Graphique 2")
        .Left = Range("a27").Left
        .Top = Range("A27").Top

  19. #19
    Membre averti
    Profil pro
    Inscrit en
    Juin 2008
    Messages
    30
    Détails du profil
    Informations personnelles :
    Âge : 53
    Localisation : France

    Informations forums :
    Inscription : Juin 2008
    Messages : 30
    Par défaut
    bon, et bien voila, je croit que c bon, je vous remercie pour vos réponse, a +

+ Répondre à la discussion
Cette discussion est résolue.

Discussions similaires

  1. Questions sur Openldap pour faire PDC
    Par valal dans le forum Réseau
    Réponses: 4
    Dernier message: 20/04/2006, 10h12
  2. Questions d'informatique pour un concours
    Par jeje00 dans le forum Langages de programmation
    Réponses: 7
    Dernier message: 04/04/2006, 08h38
  3. Réponses: 4
    Dernier message: 21/02/2006, 19h26
  4. question xml / xslt pour tableau a 3 colonnes
    Par taybott dans le forum XSL/XSLT/XPATH
    Réponses: 1
    Dernier message: 26/10/2005, 00h22
  5. Besoin d'aide pour algorithme de traitement d'images
    Par Zenman94 dans le forum Algorithmes et structures de données
    Réponses: 13
    Dernier message: 07/04/2005, 14h31

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo