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 :

Diviser une procédure trop grande


Sujet :

Macros et VBA Excel

  1. #1
    Candidat au Club
    Profil pro
    Inscrit en
    Août 2007
    Messages
    6
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Août 2007
    Messages : 6
    Points : 2
    Points
    2
    Par défaut Diviser une procédure trop grande
    Bonjour,
    je n'arrive pas à scinder en plusieurs modules la procédure ci dessous qui est trop grande. Le problème est que je fais appel à une présentation powerpoint.
    comment puis je faire pour diviser cette procédure en 2 ou 3. Je vous remercie par avance pour votre aide.

    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
     
    Sub lancerPPT()
    'on déclare une variable de type application PowerPoint
        Dim PPT As PowerPoint.Application
        Dim Sh As PowerPoint.Shape
        ' On crée maintenant un objet Presentation
        Dim Pres As PowerPoint.Presentation
     
        Set PPT = CreateObject("PowerPoint.Application")
        PPT.Visible = True 'Indispensable, sinon il ne peut pas ouvrir de fichier (Erreur)
        ' Et on lui dit de quelle présentation il s'agit :
        Set Pres = PPT.Presentations.Open("U:\Test Création Propale Taux\Test Propale VBA.ppt")
     
     With Pres
        'lien slide 1(titre)
        .Slides(1).Shapes("Text Box 42").TextFrame.TextRange.Text = Replace(.Slides(1).Shapes("Text Box 42").TextFrame.TextRange.Text, "<Nom entreprise>", Sheets("Liaisons").Range("c4"))
        .Slides(1).Shapes("Text Box 32").TextFrame.TextRange.Text = Replace(.Slides(1).Shapes("Text Box 32").TextFrame.TextRange.Text, "<date>", Format(Now, "dd/mm/yy"))
        .Slides(1).Shapes("Text Box 43").TextFrame.TextRange.Text = Replace(.Slides(1).Shapes("Text Box 43").TextFrame.TextRange.Text, "<datedujour>", Format(Now, "Dddd d mmm yyyy"))
        'lien slide 2(proposition de couvertures)
        .Slides(2).Shapes("Rectangle 5").TextFrame.TextRange.Text = Replace(.Slides(2).Shapes("Rectangle 5").TextFrame.TextRange.Text, "<nominal>", Sheets("Liaisons").Range("c5")) 'montant nominal
        .Slides(2).Shapes("Rectangle 5").TextFrame.TextRange.Text = Replace(.Slides(2).Shapes("Rectangle 5").TextFrame.TextRange.Text, "<échéance>", Sheets("Liaisons").Range("c7")) 'échéance
        .Slides(2).Shapes("Rectangle 5").TextFrame.TextRange.Text = Replace(.Slides(2).Shapes("Rectangle 5").TextFrame.TextRange.Text, "<euribor>", Sheets("Liaisons").Range("c6")) 'euribor
        .Slides(2).Shapes("Rectangle 3").TextFrame.TextRange.Text = Replace(.Slides(2).Shapes("Rectangle 3").TextFrame.TextRange.Text, "<euribor>", Sheets("Liaisons").Range("c6")) 'euribor
        .Slides(2).Shapes("Rectangle 3").TextFrame.TextRange.Text = Replace(.Slides(2).Shapes("Rectangle 3").TextFrame.TextRange.Text, "<datededépart>", Sheets("Liaisons").Range("c8")) 'date de départ
        .Slides(2).Shapes("Rectangle 3").TextFrame.TextRange.Text = Replace(.Slides(2).Shapes("Rectangle 3").TextFrame.TextRange.Text, "<datedefin>", Sheets("Liaisons").Range("c9")) 'date de fin
        .Slides(2).Shapes("Rectangle 5").TextFrame.TextRange.Text = Replace(.Slides(2).Shapes("Rectangle 5").TextFrame.TextRange.Text, "<fixing euribor>", Sheets("Liaisons").Range("c10")) 'fixing euribor
        'lien slide 3(caractéristiques SWAP DE TAUX)
        .Slides(3).Shapes("Rectangle 2").TextFrame.TextRange.Text = Replace(.Slides(3).Shapes("Rectangle 2").TextFrame.TextRange.Text, "<Euribor>", Sheets("Liaisons").Range("c6")) 'euribor
        .Slides(3).Shapes("Rectangle 15").TextFrame.TextRange.Text = Replace(.Slides(3).Shapes("Rectangle 15").TextFrame.TextRange.Text, "<Euribor>", Sheets("Liaisons").Range("c6")) 'euribor
        .Slides(3).Shapes("Rectangle 3").TextFrame.TextRange.Text = Replace(.Slides(3).Shapes("Rectangle 3").TextFrame.TextRange.Text, "<datededépart>", Sheets("Liaisons").Range("c8")) 'date de départ
        .Slides(3).Shapes("Rectangle 3").TextFrame.TextRange.Text = Replace(.Slides(3).Shapes("Rectangle 3").TextFrame.TextRange.Text, "<euribor>", Sheets("Liaisons").Range("c6")) 'euribor
        .Slides(3).Shapes("Rectangle 3").TextFrame.TextRange.Text = Replace(.Slides(3).Shapes("Rectangle 3").TextFrame.TextRange.Text, "<périodicité>", Sheets("Liaisons").Range("c19")) 'périodicité
        .Slides(3).Shapes("Rectangle 3").TextFrame.TextRange.Text = Replace(.Slides(3).Shapes("Rectangle 3").TextFrame.TextRange.Text, "<échéance>", Sheets("Liaisons").Range("c7")) 'échéance
        .Slides(3).Shapes("Rectangle 2").TextFrame.TextRange.Text = Replace(.Slides(3).Shapes("Rectangle 2").TextFrame.TextRange.Text, "<période>", Sheets("Liaisons").Range("d19")) 'période
        .Slides(3).Shapes("Rectangle 3").TextFrame.TextRange.Text = Replace(.Slides(3).Shapes("Rectangle 3").TextFrame.TextRange.Text, "<Taux de swap>", Sheets("Liaisons").Range("c18")) 'taux de swap
        'lien slide 4 (graph SWAP Classique)
        'lien slide 5(caractéristiques CAP CLASSIQUE)
        .Slides(5).Shapes("Rectangle 2").TextFrame.TextRange.Text = Replace(.Slides(5).Shapes("Rectangle 2").TextFrame.TextRange.Text, "<Euribor>", Sheets("Liaisons").Range("c6")) 'euribor
        .Slides(5).Shapes("Rectangle 3").TextFrame.TextRange.Text = Replace(.Slides(5).Shapes("Rectangle 3").TextFrame.TextRange.Text, "<datededépart>", Sheets("Liaisons").Range("c8")) 'date de départ
        .Slides(5).Shapes("Rectangle 3").TextFrame.TextRange.Text = Replace(.Slides(5).Shapes("Rectangle 3").TextFrame.TextRange.Text, "<Euribor>", Sheets("Liaisons").Range("c6")) 'euribor
        .Slides(5).Shapes("Rectangle 3").TextFrame.TextRange.Text = Replace(.Slides(5).Shapes("Rectangle 3").TextFrame.TextRange.Text, "<Périodicité>", Sheets("Liaisons").Range("c19")) 'périodicité
        .Slides(5).Shapes("Text box 58").TextFrame.TextRange.Text = Sheets("CAP CLASSIQUE").Cells(61, 5) 'légende échéance 1
        .Slides(5).Shapes("Text box 60").TextFrame.TextRange.Text = Sheets("CAP CLASSIQUE").Cells(61, 6) 'légende échéance 2
        .Slides(5).Shapes("Text box 61").TextFrame.TextRange.Text = Sheets("CAP CLASSIQUE").Cells(61, 7) 'légende échéance 3
        .Slides(5).Shapes("Text box 56").TextFrame.TextRange.Text = Sheets("CAP CLASSIQUE").Cells(63, 3) 'légende strike 1
        .Slides(5).Shapes("Text box 59").TextFrame.TextRange.Text = Sheets("CAP CLASSIQUE").Cells(65, 3) 'légende strike 2
        .Slides(5).Shapes("Text box 57").TextFrame.TextRange.Text = Sheets("CAP CLASSIQUE").Cells(67, 3) 'légende strike 3
        .Slides(5).Shapes("Text box 62").TextFrame.TextRange.Text = Sheets("CAP CLASSIQUE").Cells(63, 5) 'prime strike 1 / échéance 1
        .Slides(5).Shapes("Text box 63").TextFrame.TextRange.Text = Sheets("CAP CLASSIQUE").Cells(63, 6) 'prime strike 1 / échéance 2
        .Slides(5).Shapes("Text box 64").TextFrame.TextRange.Text = Sheets("CAP CLASSIQUE").Cells(63, 7) 'prime strike 1 / échéance 3
        .Slides(5).Shapes("Text box 65").TextFrame.TextRange.Text = Sheets("CAP CLASSIQUE").Cells(65, 5) 'prime strike 2 / échéance 1
        .Slides(5).Shapes("Text box 66").TextFrame.TextRange.Text = Sheets("CAP CLASSIQUE").Cells(65, 6) 'prime strike 2 / échéance 2
        .Slides(5).Shapes("Text box 67").TextFrame.TextRange.Text = Sheets("CAP CLASSIQUE").Cells(65, 7) 'prime strike 2 / échéance 3
        .Slides(5).Shapes("Text box 68").TextFrame.TextRange.Text = Sheets("CAP CLASSIQUE").Cells(67, 5) 'prime strike 3 / échéance 1
        .Slides(5).Shapes("Text box 69").TextFrame.TextRange.Text = Sheets("CAP CLASSIQUE").Cells(67, 6) 'prime strike 3 / échéance 2
        .Slides(5).Shapes("Text box 70").TextFrame.TextRange.Text = Sheets("CAP CLASSIQUE").Cells(68, 7) 'prime strike 3 / échéance 3
        'lien slide 6( graph CAP Classique)
        .Slides(6).Shapes("Rectangle 2").TextFrame.TextRange.Text = Replace(.Slides(6).Shapes("Rectangle 2").TextFrame.TextRange.Text, "<période>", Sheets("Liaisons").Range("c19")) 'période
        .Slides(6).Shapes("Rectangle 21").TextFrame.TextRange.Text = Replace(.Slides(6).Shapes("Rectangle 21").TextFrame.TextRange.Text, "<Euribor>", Sheets("Liaisons").Range("c6")) 'euribor
        .Slides(6).Shapes("Rectangle 21").TextFrame.TextRange.Text = Replace(.Slides(6).Shapes("Rectangle 21").TextFrame.TextRange.Text, "<Strike>", Sheets("CAP CLASSIQUE").Range("f11")) 'Strike du CAP
        'lien slide 7(avantages / inconvénients CAP CLASSIQUE)
        .Slides(7).Shapes("Rectangle 2").TextFrame.TextRange.Text = Replace(.Slides(7).Shapes("Rectangle 2").TextFrame.TextRange.Text, "<Euribor>", Sheets("Liaisons").Range("c6")) 'Euribor
        'lien slide 8(caractéristiques CAP A DEGRES)
        .Slides(8).Shapes("Rectangle 2").TextFrame.TextRange.Text = Replace(.Slides(8).Shapes("Rectangle 2").TextFrame.TextRange.Text, "<Euribor>", Sheets("Liaisons").Range("c6")) 'Euribor
        .Slides(8).Shapes("Rectangle 3").TextFrame.TextRange.Text = Replace(.Slides(8).Shapes("Rectangle 3").TextFrame.TextRange.Text, "<datededépart>", Sheets("Liaisons").Range("c8")) 'date de départ
        .Slides(8).Shapes("Rectangle 3").TextFrame.TextRange.Text = Replace(.Slides(8).Shapes("Rectangle 3").TextFrame.TextRange.Text, "<datedefin>", Sheets("Liaisons").Range("c9")) 'date de fin
        .Slides(8).Shapes("Rectangle 3").TextFrame.TextRange.Text = Replace(.Slides(8).Shapes("Rectangle 3").TextFrame.TextRange.Text, "<Euribor>", Sheets("Liaisons").Range("c6")) 'Euribor
        .Slides(8).Shapes("Rectangle 11").TextFrame.TextRange.Text = Replace(.Slides(8).Shapes("Rectangle 11").TextFrame.TextRange.Text, "<période>", Sheets("Liaisons").Range("c19")) 'période
        .Slides(8).Shapes("Rectangle 16").TextFrame.TextRange.Text = Replace(.Slides(8).Shapes("Rectangle 16").TextFrame.TextRange.Text, "<proposition 1>", Sheets("CAP A PALIERS").Range("g74")) 'proposition 1
        .Slides(8).Shapes("Rectangle 16").TextFrame.TextRange.Text = Replace(.Slides(8).Shapes("Rectangle 16").TextFrame.TextRange.Text, "<proposition 2>", Sheets("CAP A PALIERS").Range("g75")) 'proposition 2
        .Slides(8).Shapes("Rectangle 16").TextFrame.TextRange.Text = Replace(.Slides(8).Shapes("Rectangle 16").TextFrame.TextRange.Text, "<proposition 3>", Sheets("CAP A PALIERS").Range("g76")) 'proposition 3
        .Slides(8).Shapes("Rectangle 17").TextFrame.TextRange.Text = Replace(.Slides(8).Shapes("Rectangle 17").TextFrame.TextRange.Text, "<prime 1>", Sheets("CAP A PALIERS").Range("c61")) 'prime 1
        .Slides(8).Shapes("Rectangle 17").TextFrame.TextRange.Text = Replace(.Slides(8).Shapes("Rectangle 17").TextFrame.TextRange.Text, "<prime 2>", Sheets("CAP A PALIERS").Range("c66")) 'prime 2
        .Slides(8).Shapes("Rectangle 17").TextFrame.TextRange.Text = Replace(.Slides(8).Shapes("Rectangle 17").TextFrame.TextRange.Text, "<prime 3>", Sheets("CAP A PALIERS").Range("c71")) 'prime 3
        'lien slide 9(graph CAP A DEGRES)
        .Slides(9).Shapes("Rectangle 9").TextFrame.TextRange.Text = Replace(.Slides(9).Shapes("Rectangle 9").TextFrame.TextRange.Text, "<périodicité>", Sheets("Liaisons").Range("c519")) 'périodicité
        .Slides(9).Shapes("Rectangle 7").TextFrame.TextRange.Text = Replace(.Slides(9).Shapes("Rectangle 7").TextFrame.TextRange.Text, "<Euribor>", Sheets("Liaisons").Range("c6")) 'Euribor
        .Slides(9).Shapes("Rectangle 7").TextFrame.TextRange.Text = Replace(.Slides(9).Shapes("Rectangle 7").TextFrame.TextRange.Text, "<strike1>", Sheets("CAP A PALIERS").Range("f11")) 'strike1
        .Slides(9).Shapes("Rectangle 7").TextFrame.TextRange.Text = Replace(.Slides(9).Shapes("Rectangle 7").TextFrame.TextRange.Text, "<strike2>", Sheets("CAP A PALIERS").Range("g11")) 'strike2
        'lien slide 10(avantages / inconvénients CAP A DEGRES)
        .Slides(10).Shapes("Rectangle 2").TextFrame.TextRange.Text = Replace(.Slides(10).Shapes("Rectangle 2").TextFrame.TextRange.Text, "<Euribor>", Sheets("Liaisons").Range("c6")) 'Euribor
        .Slides(10).Shapes("Rectangle 2").TextFrame.TextRange.Text = Replace(.Slides(10).Shapes("Rectangle 2").TextFrame.TextRange.Text, "<Euribor>", Sheets("Liaisons").Range("c6")) 'Euribor
        'lien slide 11(caractéristiques SWAP SEMI FIXE)
        .Slides(11).Shapes("Rectangle 2").TextFrame.TextRange.Text = Replace(.Slides(11).Shapes("Rectangle 2").TextFrame.TextRange.Text, "<Euribor>", Sheets("Liaisons").Range("c6")) 'Euribor
        .Slides(11).Shapes("Rectangle 3").TextFrame.TextRange.Text = Replace(.Slides(11).Shapes("Rectangle 3").TextFrame.TextRange.Text, "<datededépart>", Sheets("Liaisons").Range("c8")) 'date de départ
        .Slides(11).Shapes("Rectangle 3").TextFrame.TextRange.Text = Replace(.Slides(11).Shapes("Rectangle 3").TextFrame.TextRange.Text, "<datedefin>", Sheets("Liaisons").Range("c9")) 'date de fin
        .Slides(11).Shapes("Rectangle 3").TextFrame.TextRange.Text = Replace(.Slides(11).Shapes("Rectangle 3").TextFrame.TextRange.Text, "<Euriborpost>", Sheets("SWAP SEMI FIXE").Range("e5")) 'Euribor post
        .Slides(11).Shapes("Rectangle 3").TextFrame.TextRange.Text = Replace(.Slides(11).Shapes("Rectangle 3").TextFrame.TextRange.Text, "<Taux bonifié>", Sheets("SWAP SEMI FIXE").Range("e10")) 'Taux bonifié
        .Slides(11).Shapes("Rectangle 3").TextFrame.TextRange.Text = Replace(.Slides(11).Shapes("Rectangle 3").TextFrame.TextRange.Text, "<KI>", Sheets("SWAP SEMI FIXE").Range("f10")) 'KI
        'lien slide 12(graph SWAP SEMI FIXE)
        .Slides(12).Shapes("Rectangle 9").TextFrame.TextRange.Text = Replace(.Slides(12).Shapes("Rectangle 9").TextFrame.TextRange.Text, "<périodicité>", Sheets("Liaisons").Range("c19")) 'périodicité
        .Slides(12).Shapes("Rectangle 2").TextFrame.TextRange.Text = Replace(.Slides(12).Shapes("Rectangle 2").TextFrame.TextRange.Text, "<Euriborpost>", Sheets("SWAP SEMI FIXE").Range("e5")) 'Euribor post
        .Slides(12).Shapes("Rectangle 2").TextFrame.TextRange.Text = Replace(.Slides(12).Shapes("Rectangle 2").TextFrame.TextRange.Text, "<taux bonifié>", Sheets("SWAP SEMI FIXE").Range("e10")) 'taux bonifié
        .Slides(12).Shapes("Rectangle 2").TextFrame.TextRange.Text = Replace(.Slides(12).Shapes("Rectangle 2").TextFrame.TextRange.Text, "<KI>", Sheets("SWAP SEMI FIXE").Range("f10")) 'KI
        'lien slide 13(avantages / inconvénients SWAP SEMI FIXE CLASSIQUE)
        .Slides(13).Shapes("Rectangle 4").TextFrame.TextRange.Text = Replace(.Slides(13).Shapes("Rectangle 4").TextFrame.TextRange.Text, "<Euriborpost>", Sheets("SWAP SEMI FIXE").Range("e5")) 'Euribor post
        'lien slide 14(swap semi fixe cappé)
        .Slides(14).Shapes("Rectangle 2").TextFrame.TextRange.Text = Replace(.Slides(14).Shapes("Rectangle 2").TextFrame.TextRange.Text, "<Euribor>", Sheets("Liaisons").Range("c6")) 'Euribor
        .Slides(14).Shapes("Rectangle 3").TextFrame.TextRange.Text = Replace(.Slides(14).Shapes("Rectangle 3").TextFrame.TextRange.Text, "<datededépart>", Sheets("Liaisons").Range("c8")) 'date de départ
        .Slides(14).Shapes("Rectangle 3").TextFrame.TextRange.Text = Replace(.Slides(14).Shapes("Rectangle 3").TextFrame.TextRange.Text, "<datedefin>", Sheets("Liaisons").Range("c9")) 'date de fin
        .Slides(14).Shapes("Rectangle 3").TextFrame.TextRange.Text = Replace(.Slides(14).Shapes("Rectangle 3").TextFrame.TextRange.Text, "<Euriborpost>", Sheets("SWAP SEMI FIXE CAPPE").Range("e5")) 'Euribor post
        .Slides(14).Shapes("Rectangle 3").TextFrame.TextRange.Text = Replace(.Slides(14).Shapes("Rectangle 3").TextFrame.TextRange.Text, "<taux bonifié>", Sheets("SWAP SEMI FIXE CAPPE").Range("e10")) 'Taux bonifié
        .Slides(14).Shapes("Rectangle 3").TextFrame.TextRange.Text = Replace(.Slides(14).Shapes("Rectangle 3").TextFrame.TextRange.Text, "<KI>", Sheets("SWAP SEMI FIXE CAPPE").Range("f10")) 'KI
        .Slides(14).Shapes("Rectangle 3").TextFrame.TextRange.Text = Replace(.Slides(14).Shapes("Rectangle 3").TextFrame.TextRange.Text, "<CAP>", Sheets("SWAP SEMI FIXE CAPPE").Range("e13")) 'CAP
        'lien slide 15(graph swap semi fixe cappé)
        .Slides(15).Shapes("Rectangle 10").TextFrame.TextRange.Text = Replace(.Slides(15).Shapes("Rectangle 10").TextFrame.TextRange.Text, "<périodicité>", Sheets("Liaisons").Range("c19")) 'périodicité
        .Slides(15).Shapes("Rectangle 2").TextFrame.TextRange.Text = Replace(.Slides(15).Shapes("Rectangle 2").TextFrame.TextRange.Text, "<Euriborpost>", Sheets("SWAP SEMI FIXE CAPPE").Range("e5")) 'Euribor post
        .Slides(15).Shapes("Rectangle 2").TextFrame.TextRange.Text = Replace(.Slides(15).Shapes("Rectangle 2").TextFrame.TextRange.Text, "<taux bonifié>", Sheets("SWAP SEMI FIXE CAPPE").Range("e10")) 'taux bonifié
        .Slides(15).Shapes("Rectangle 2").TextFrame.TextRange.Text = Replace(.Slides(15).Shapes("Rectangle 2").TextFrame.TextRange.Text, "<KI>", Sheets("SWAP SEMI FIXE CAPPE").Range("f10")) 'KI
        .Slides(15).Shapes("Rectangle 2").TextFrame.TextRange.Text = Replace(.Slides(15).Shapes("Rectangle 2").TextFrame.TextRange.Text, "<CAP>", Sheets("SWAP SEMI FIXE CAPPE").Range("e13")) 'CAP
        'lien slide 16((avantages / inconvénients swap semi fixe cappé)
        .Slides(16).Shapes("Rectangle 2").TextFrame.TextRange.Text = Replace(.Slides(16).Shapes("Rectangle 2").TextFrame.TextRange.Text, "<Euriborpost>", Sheets("SWAP SEMI FIXE CAPPE").Range("e5")) 'Euribor post
        .Slides(16).Shapes("Rectangle 4").TextFrame.TextRange.Text = Replace(.Slides(16).Shapes("Rectangle 4").TextFrame.TextRange.Text, "<Euriborpost>", Sheets("SWAP SEMI FIXE CAPPE").Range("e5")) 'Euribor post
        'lien slide 17(caractéristiques tunnel classique)
        .Slides(17).Shapes("Rectangle 3").TextFrame.TextRange.Text = Replace(.Slides(17).Shapes("Rectangle 3").TextFrame.TextRange.Text, "<Euribor>", Sheets("Liaisons").Range("c6")) 'Euribor
        .Slides(17).Shapes("Rectangle 3").TextFrame.TextRange.Text = Replace(.Slides(17).Shapes("Rectangle 3").TextFrame.TextRange.Text, "<datededépart>", Sheets("Liaisons").Range("c8")) 'date de départ
        .Slides(17).Shapes("Rectangle 3").TextFrame.TextRange.Text = Replace(.Slides(17).Shapes("Rectangle 3").TextFrame.TextRange.Text, "<datedefin>", Sheets("Liaisons").Range("c9")) 'date de fin
        .Slides(17).Shapes("Rectangle 3").TextFrame.TextRange.Text = Replace(.Slides(17).Shapes("Rectangle 3").TextFrame.TextRange.Text, "<CAP>", Sheets("TUNNEL CLASSIQUE").Range("f10")) 'CAP
        .Slides(17).Shapes("Rectangle 3").TextFrame.TextRange.Text = Replace(.Slides(17).Shapes("Rectangle 3").TextFrame.TextRange.Text, "<Floor>", Sheets("TUNNEL CLASSIQUE").Range("f13")) 'FLOOR
        'lien slide 18(graph tunnel classique)
        .Slides(18).Shapes("Rectangle 9").TextFrame.TextRange.Text = Replace(.Slides(18).Shapes("Rectangle 9").TextFrame.TextRange.Text, "<périodicité>", Sheets("Liaisons").Range("c19")) 'périodicité
        .Slides(18).Shapes("Rectangle 2").TextFrame.TextRange.Text = Replace(.Slides(18).Shapes("Rectangle 2").TextFrame.TextRange.Text, "<Euribor>", Sheets("Liaisons").Range("c6")) 'Euribor
        .Slides(18).Shapes("Rectangle 2").TextFrame.TextRange.Text = Replace(.Slides(18).Shapes("Rectangle 2").TextFrame.TextRange.Text, "<CAP>", Sheets("TUNNEL CLASSIQUE").Range("f10")) 'CAP
        .Slides(18).Shapes("Rectangle 2").TextFrame.TextRange.Text = Replace(.Slides(18).Shapes("Rectangle 2").TextFrame.TextRange.Text, "<Floor>", Sheets("TUNNEL CLASSIQUE").Range("f13")) 'FLOOR
        'lien slide 19(avantages / inconvénients tunnel classique)
        .Slides(19).Shapes("Rectangle 2").TextFrame.TextRange.Text = Replace(.Slides(19).Shapes("Rectangle 2").TextFrame.TextRange.Text, "<Euribor>", Sheets("Liaisons").Range("c6")) 'Euribor
        'lien slide 20(caractéristiques tunnel activant)
        .Slides(20).Shapes("Rectangle 2").TextFrame.TextRange.Text = Replace(.Slides(20).Shapes("Rectangle 2").TextFrame.TextRange.Text, "<Euribor>", Sheets("Liaisons").Range("c6")) 'Euribor
        .Slides(20).Shapes("Rectangle 2").TextFrame.TextRange.Text = Replace(.Slides(20).Shapes("Rectangle 2").TextFrame.TextRange.Text, "<datededépart>", Sheets("Liaisons").Range("c8")) 'date de départ
        .Slides(20).Shapes("Rectangle 2").TextFrame.TextRange.Text = Replace(.Slides(20).Shapes("Rectangle 2").TextFrame.TextRange.Text, "<datedefin>", Sheets("Liaisons").Range("c9")) 'date de fin
        .Slides(20).Shapes("Rectangle 2").TextFrame.TextRange.Text = Replace(.Slides(20).Shapes("Rectangle 2").TextFrame.TextRange.Text, "<CAP>", Sheets("TUNNEL ACTIVANT").Range("f10")) 'CAP
        .Slides(20).Shapes("Rectangle 2").TextFrame.TextRange.Text = Replace(.Slides(20).Shapes("Rectangle 2").TextFrame.TextRange.Text, "<Floor>", Sheets("TUNNEL ACTIVANT").Range("f13")) 'FLOOR
        .Slides(20).Shapes("Rectangle 2").TextFrame.TextRange.Text = Replace(.Slides(20).Shapes("Rectangle 2").TextFrame.TextRange.Text, "<KI>", Sheets("TUNNEL ACTIVANT").Range("g13")) 'BARRIERE KI
        'lien slide 21(graph tunnel activant)
        .Slides(21).Shapes("Rectangle 9").TextFrame.TextRange.Text = Replace(.Slides(21).Shapes("Rectangle 9").TextFrame.TextRange.Text, "<périodicité>", Sheets("Liaisons").Range("c19")) 'périodicité
        .Slides(21).Shapes("Rectangle 3").TextFrame.TextRange.Text = Replace(.Slides(21).Shapes("Rectangle 3").TextFrame.TextRange.Text, "<Euribor>", Sheets("Liaisons").Range("c6")) 'Euribor
        .Slides(21).Shapes("Rectangle 3").TextFrame.TextRange.Text = Replace(.Slides(21).Shapes("Rectangle 3").TextFrame.TextRange.Text, "<CAP>", Sheets("TUNNEL ACTIVANT").Range("f10")) 'CAP
        .Slides(21).Shapes("Rectangle 3").TextFrame.TextRange.Text = Replace(.Slides(21).Shapes("Rectangle 3").TextFrame.TextRange.Text, "<Floor>", Sheets("TUNNEL ACTIVANT").Range("f13")) 'FLOOR
        .Slides(21).Shapes("Rectangle 3").TextFrame.TextRange.Text = Replace(.Slides(21).Shapes("Rectangle 3").TextFrame.TextRange.Text, "<KI>", Sheets("TUNNEL ACTIVANT").Range("g13")) 'KI
        'lien slide 22(avantages / inconvénients tunnel activant)
        .Slides(22).Shapes("Rectangle 2").TextFrame.TextRange.Text = Replace(.Slides(22).Shapes("Rectangle 2").TextFrame.TextRange.Text, "<CAP>", Sheets("TUNNEL ACTIVANT").Range("f10")) 'CAP
        .Slides(22).Shapes("Rectangle 7").TextFrame.TextRange.Text = Replace(.Slides(22).Shapes("Rectangle 7").TextFrame.TextRange.Text, "<Floor>", Sheets("TUNNEL ACTIVANT").Range("f13")) 'FLOOR
        .Slides(22).Shapes("Rectangle 2").TextFrame.TextRange.Text = Replace(.Slides(22).Shapes("Rectangle 2").TextFrame.TextRange.Text, "<KI>", Sheets("TUNNEL ACTIVANT").Range("g13")) 'KI
        .Slides(22).Shapes("Rectangle 7").TextFrame.TextRange.Text = Replace(.Slides(22).Shapes("Rectangle 7").TextFrame.TextRange.Text, "<KI>", Sheets("TUNNEL ACTIVANT").Range("g13")) 'KI
        'lien slide 23(caractéristiques Tunnel activant à paliers)
        .Slides(23).Shapes("Rectangle 5").TextFrame.TextRange.Text = Replace(.Slides(23).Shapes("Rectangle 5").TextFrame.TextRange.Text, "<Euribor>", Sheets("Liaisons").Range("c6")) 'Euribor
        .Slides(23).Shapes("Rectangle 5").TextFrame.TextRange.Text = Replace(.Slides(23).Shapes("Rectangle 5").TextFrame.TextRange.Text, "<datededépart>", Sheets("Liaisons").Range("c8")) 'date de départ
        .Slides(23).Shapes("Rectangle 5").TextFrame.TextRange.Text = Replace(.Slides(23).Shapes("Rectangle 5").TextFrame.TextRange.Text, "<datedefin>", Sheets("Liaisons").Range("c9")) 'date de fin
        .Slides(23).Shapes("Rectangle 5").TextFrame.TextRange.Text = Replace(.Slides(23).Shapes("Rectangle 5").TextFrame.TextRange.Text, "<CAP1>", Sheets("TUNNEL ACTIVANT A PALIERS").Range("f10")) 'CAP1
        .Slides(23).Shapes("Rectangle 5").TextFrame.TextRange.Text = Replace(.Slides(23).Shapes("Rectangle 5").TextFrame.TextRange.Text, "<CAP2>", Sheets("TUNNEL ACTIVANT A PALIERS").Range("g10")) 'CAP2
        .Slides(23).Shapes("Rectangle 5").TextFrame.TextRange.Text = Replace(.Slides(23).Shapes("Rectangle 5").TextFrame.TextRange.Text, "<Floor>", Sheets("TUNNEL ACTIVANT A PALIERS").Range("f13")) 'FLOOR
        .Slides(23).Shapes("Rectangle 5").TextFrame.TextRange.Text = Replace(.Slides(23).Shapes("Rectangle 5").TextFrame.TextRange.Text, "<KI>", Sheets("TUNNEL ACTIVANT A PALIERS").Range("g13")) 'BARRIERE KI
        'lien slide 24(graph tunnel activant à paliers)
        .Slides(24).Shapes("Rectangle 6").TextFrame.TextRange.Text = Replace(.Slides(24).Shapes("Rectangle 6").TextFrame.TextRange.Text, "<périodicité>", Sheets("Liaisons").Range("c19")) 'périodicité
     
     
     
     End With
     
     'ajust l'echelle des graphs en fonction des strike
     Call ajustchart
     
     'GRAPH SWAP CLASSIQUE
      ' On active, sélectionne et copie le Graphique SWAP Classique de Excel :
        Sheets("SWAP CLASSIQUE").Select
        ActiveSheet.ChartObjects("Graphique 1").Activate
        ActiveChart.ChartArea.Copy
        'colle dans le slide SWAP Classique de la présentation :
        Pres.Slides(4).Shapes.Paste
     
        'GRAPH CAP CLASSIQUE
        If Userform1_propale.CheckBox_CAP_Classique = True Then
        Sheets("CAP CLASSIQUE").Select
        ActiveSheet.ChartObjects("Graphique 1").Activate
        ActiveChart.ChartArea.Copy
        Pres.Slides(6).Shapes.Paste.Top = 50
        End If
     
        'GRAPH CAP A PALIERS
        If Userform1_propale.CheckBox_CAP_à_Paliers = True Then
        Sheets("CAP A PALIERS").Select
        ActiveSheet.ChartObjects("Graphique 1").Activate
        ActiveChart.ChartArea.Copy
        Pres.Slides(9).Shapes.Paste.Top = 50
        End If
     
        'GRAPH SWAP SEMI FIXE
        If Userform1_propale.CheckBox_SWAP_semi_fixe = True Then
        Sheets("SWAP SEMI FIXE").Select
        ActiveSheet.ChartObjects("Graphique 1").Activate
        ActiveChart.ChartArea.Copy
        Pres.Slides(12).Shapes.Paste.Top = 47
        End If
     
        'GRAPH SWAP SEMI FIXE CAPPE
        If Userform1_propale.CheckBox_SWAP_semi_fixe_cappé = True Then
        Sheets("SWAP SEMI FIXE CAPPE").Select
        ActiveSheet.ChartObjects("Graphique 1").Activate
        ActiveChart.ChartArea.Copy
        Pres.Slides(15).Shapes.Paste.Top = 47
        End If
     
        'GRAPH TUNNEL CLASSIQUE
        If Userform1_propale.CheckBox_tunnel_classique = True Then
        Sheets("TUNNEL CLASSIQUE").Select
        ActiveSheet.ChartObjects("Graphique 1").Activate
        ActiveChart.ChartArea.Copy
        Pres.Slides(18).Shapes.Paste.Top = 47
        End If
     
       'GRAPH TUNNEL ACTIVANT
        If Userform1_propale.CheckBox_tunnel_activant = True Then
        Sheets("TUNNEL ACTIVANT").Select
        ActiveSheet.ChartObjects("Graphique 1").Activate
        ActiveChart.ChartArea.Copy
        Pres.Slides(21).Shapes.Paste.Top = 47
        End If
     
        'GRAPH TUNNEL ACTIVANT A PALIERS
        If Userform1_propale.CheckBox_tunnel_activant_paliers = True Then
        Sheets("TUNNEL ACTIVANT A PALIERS").Select
        ActiveSheet.ChartObjects("Graphique 1").Activate
        ActiveChart.ChartArea.Copy
        Pres.Slides(24).Shapes.Paste.Top = 47
        End If
     
        'GRAPH TUNNEL DESACTIVANT
        If Userform1_propale.CheckBox_tunnel_désactivant = True Then
        Sheets("TUNNEL DESACTIVANT").Select
        ActiveSheet.ChartObjects("Graphique 1").Activate
        ActiveChart.ChartArea.Copy
        Pres.Slides(27).Shapes.Paste.Top = 50
        End If
     
        'GRAPH swap participatif classique
        If Userform1_propale.CheckBox_SWAP_Participatif_classique = True Then
        Sheets("SWAP PARTICIPATIF").Select
        ActiveSheet.ChartObjects("Graphique 1").Activate
        ActiveChart.ChartArea.Copy
        Pres.Slides(30).Shapes.Paste.Top = 47
        End If
     
       'GRAPH swap participatif a paliers
        If Userform1_propale.CheckBox_SWAP_participatif_à_paliers = True Then
        Sheets("SWAP PARTICIPATIF A PALIERS").Select
        ActiveSheet.ChartObjects("Graphique 1").Activate
        ActiveChart.ChartArea.Copy
        Pres.Slides(33).Shapes.Paste.Top = 47
        End If
     
        'GRAPH swap participatif désactivant
        If Userform1_propale.CheckBox_SWAP_participatif_désactivant = True Then
        Sheets("SWAP PARTICIPATIF DESACTIVANT").Select
        ActiveSheet.ChartObjects("Graphique 1").Activate
        'ActiveChart.ChartArea.Select
        ActiveChart.ChartArea.Copy
        Pres.Slides(36).Shapes.Paste.Top = 47
        End If
     
         'masquer les diapos non concernées par les stratégies
        If Userform1_propale.CheckBox_SWAP_participatif_désactivant = False Then
        Pres.Slides(35).Delete
        Pres.Slides(35).Delete
        Pres.Slides(35).Delete
        End If
        If Userform1_propale.CheckBox_SWAP_participatif_à_paliers = False Then
        Pres.Slides(32).Delete
        Pres.Slides(32).Delete
        Pres.Slides(32).Delete
        End If
        If Userform1_propale.CheckBox_SWAP_Participatif_classique = False Then
        Pres.Slides(29).Delete
        Pres.Slides(29).Delete
        Pres.Slides(29).Delete
        End If
        If Userform1_propale.CheckBox_tunnel_désactivant = False Then
        Pres.Slides(26).Delete
        Pres.Slides(26).Delete
        Pres.Slides(26).Delete
        End If
        If Userform1_propale.CheckBox_tunnel_activant_paliers = False Then
        Pres.Slides(23).Delete
        Pres.Slides(23).Delete
        Pres.Slides(23).Delete
        End If
        If Userform1_propale.CheckBox_tunnel_activant = False Then
        Pres.Slides(20).Delete
        Pres.Slides(20).Delete
        Pres.Slides(20).Delete
        End If
        If Userform1_propale.CheckBox_tunnel_classique = False Then
        Pres.Slides(17).Delete
        Pres.Slides(17).Delete
        Pres.Slides(17).Delete
        End If
        If Userform1_propale.CheckBox_SWAP_semi_fixe_cappé = False Then
        Pres.Slides(14).Delete
        Pres.Slides(14).Delete
        Pres.Slides(14).Delete
        End If
        If Userform1_propale.CheckBox_SWAP_semi_fixe = False Then
        Pres.Slides(11).Delete
        Pres.Slides(11).Delete
        Pres.Slides(11).Delete
        End If
        If Userform1_propale.CheckBox_CAP_à_Paliers = False Then
        Pres.Slides(8).Delete
        Pres.Slides(8).Delete
        Pres.Slides(8).Delete
        End If
        If Userform1_propale.CheckBox_CAP_Classique = False Then
        Pres.Slides(5).Delete
        Pres.Slides(5).Delete
        Pres.Slides(5).Delete
        End If
     
     
        Pres.SaveAs "U:\Propale\" & Sheets("Liaisons").Cells(4, 3) & " " & Format(Date, "dd-mm-yy") & ".ppt"
     
        MsgBox "Propale terminée.", vbInformation, "Génération propale CIC"
     
    End Sub

  2. #2
    Membre régulier
    Profil pro
    Inscrit en
    Août 2007
    Messages
    95
    Détails du profil
    Informations personnelles :
    Âge : 40
    Localisation : France

    Informations forums :
    Inscription : Août 2007
    Messages : 95
    Points : 99
    Points
    99
    Par défaut
    Salut,

    non, je ne vois pas comment scinder ton code. Il est pas si monstrueux que ça...

    Par contre, tu pourrais le rendre plus court et plus efficace en faisant des modifs facilement.
    Exemple:
    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
     
    If Userform1_propale.CheckBox_SWAP_participatif_désactivant = True Then
        Sheets("SWAP PARTICIPATIF DESACTIVANT").Select
        ActiveSheet.ChartObjects("Graphique 1").Activate
        'ActiveChart.ChartArea.Select
        ActiveChart.ChartArea.Copy
        Pres.Slides(36).Shapes.Paste.Top = 47
    End If
     
         'masquer les diapos non concernées par les stratégies
    If Userform1_propale.CheckBox_SWAP_participatif_désactivant = False Then
        Pres.Slides(35).Delete
        Pres.Slides(35).Delete
        Pres.Slides(35).Delete
    End If
    pourrait être récrit par:
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
     
    If Userform1_propale.CheckBox_SWAP_participatif_désactivant = True Then
        Sheets("SWAP PARTICIPATIF DESACTIVANT").Select
        ActiveSheet.ChartObjects("Graphique 1").Activate
        'ActiveChart.ChartArea.Select
        ActiveChart.ChartArea.Copy
        Pres.Slides(36).Shapes.Paste.Top = 47
        Else
          'masquer les diapos non concernées par les stratégies
        Pres.Slides(35).Delete
        Pres.Slides(35).Delete
        Pres.Slides(35).Delete
    End If
    Je pense qu'il y a pas mal de trucs comme ça dans ton code.

Discussions similaires

  1. procédure trop grande
    Par Selune6666 dans le forum Macros et VBA Excel
    Réponses: 3
    Dernier message: 06/02/2008, 18h21
  2. VB erreur d'ouverture d'une image trop grande
    Par syldudu dans le forum Access
    Réponses: 2
    Dernier message: 04/01/2008, 16h18
  3. Procédure trop grande
    Par bobie dans le forum Macros et VBA Excel
    Réponses: 2
    Dernier message: 13/08/2007, 14h30
  4. Une procédure trop longue
    Par lola06 dans le forum VBA Access
    Réponses: 2
    Dernier message: 15/05/2007, 14h02
  5. Faire glisser une image trop grande avec la souris
    Par avogadro dans le forum Général JavaScript
    Réponses: 25
    Dernier message: 28/07/2006, 16h50

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