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 :

Deselectionner un graphique


Sujet :

Macros et VBA Excel

Vue hybride

Message précédent Message précédent   Message suivant Message suivant
  1. #1
    Membre expérimenté Avatar de vanhoa
    Homme Profil pro
    Analyste Financier
    Inscrit en
    Octobre 2013
    Messages
    117
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : Thaïlande

    Informations professionnelles :
    Activité : Analyste Financier
    Secteur : Industrie

    Informations forums :
    Inscription : Octobre 2013
    Messages : 117
    Par défaut Deselectionner un graphique
    Bonjour a tous,

    Mon prebleme est tres simple. J'ai realise un graphique interactif. Dans mon code je realise une mise en forme conditionnelle des colonnes, donc je suis oblige de selectionner mon graphique a un moment ou un autre. Seulement, j'aimerais que le graphique se deselectionne a la fin, pour des questions d'esthetique. Mais, impossible de trouver comment faire

    J'ai deja essaye ActiveChart.Deselect, mais ca ne change rien, ca reste selectionne! J'ai essaye de selectionner quelque chose d'autre, une autre cellule par exemple, mais mon graph reste toujours selectionne et la cellule ne se selectionne pas!

    Donc j'aurais besoin de votre aide.
    Est ce que ca viens du fait de passer par une fonction personnalise et un lien hyperlink (pour activer cette fonction) afin de realiser mon graph interactif?

    Si besoin, je peux mettre le fichier en piece jointe pour que vous puissiez voir le code, ou alors je peux copier/coller le code.

    Merci encore,

    Vanhoa

  2. #2
    Expert éminent Avatar de Menhir
    Homme Profil pro
    Ingénieur
    Inscrit en
    Juin 2007
    Messages
    16 037
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Finistère (Bretagne)

    Informations professionnelles :
    Activité : Ingénieur
    Secteur : Industrie

    Informations forums :
    Inscription : Juin 2007
    Messages : 16 037
    Par défaut
    Contrairement à Word (dont l'objet Document" possède la méthode Collapse), je ne pense pas qu'il soit possible, dans Excel, de ne rien sélectionner (même à la main). Corolaire, il n'est donc pas possible de désélectionner autrement qu'en sélectionnant quelque chose d'autre.

    La seule méthode que je vois pour que ton graphique ne soit plus sélectionné, c'est de sélectionner autre chose.
    Par exemple Range("A1").Select, tout simplement.

  3. #3
    Membre expérimenté Avatar de vanhoa
    Homme Profil pro
    Analyste Financier
    Inscrit en
    Octobre 2013
    Messages
    117
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : Thaïlande

    Informations professionnelles :
    Activité : Analyste Financier
    Secteur : Industrie

    Informations forums :
    Inscription : Octobre 2013
    Messages : 117
    Par défaut
    Oui, j'avais deja essayede selectionner une autre cellule, mais ca ne marche pas. La cellule ne s'active pas visuellement. Donc je me suis dis, pour etre sur je vais faire pas a pas: cells(1,1).select puis cells(1,1)="test"
    Donc en cellule A1 j'ai bien "test" qui apparrait, mais mon graph reste selectionne!! Decidement, je ne comprends pas...

  4. #4
    Expert éminent Avatar de Menhir
    Homme Profil pro
    Ingénieur
    Inscrit en
    Juin 2007
    Messages
    16 037
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Finistère (Bretagne)

    Informations professionnelles :
    Activité : Ingénieur
    Secteur : Industrie

    Informations forums :
    Inscription : Juin 2007
    Messages : 16 037
    Par défaut
    Dans ton cas, le cells(1,1)="test" n'a pas d'intérêt puisqu'il n'est pas nécessaire de sélectionner une macro pour changer sa valeur.
    Je viens de faire le test. J'ai créé une macro qui contient simplement un cells(1,1).select, j'ai créé dans ma feuille un graphique simple que j'ai sélectionné et j'ai lancé ma macro. J'ai bien la cellule qui se sélectionne et le rectangle qui est désélectionné.

    Où alors tu n'as pas bien expliqué des particularités de ton graphique. Y aurait-il quelque chose qui le re-sélectionnerait automatiquement comme une fonction ?

  5. #5
    Membre expérimenté Avatar de vanhoa
    Homme Profil pro
    Analyste Financier
    Inscrit en
    Octobre 2013
    Messages
    117
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : Thaïlande

    Informations professionnelles :
    Activité : Analyste Financier
    Secteur : Industrie

    Informations forums :
    Inscription : Octobre 2013
    Messages : 117
    Par défaut
    Oui,

    en fait mon graphique est interactif, et j'ai egalement rajouter une mise en forme conditionnelle des colonnes du graph, m'obligeant a selectionner mon graph via mon code.

    Mais dans mon code, je ne vois pas ce qui empeche de le deselectionner

    je mets mon fichier en piece jointe pour que tu puisses mieux te rendre compte


    et ici mon code egalement:


    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
     
    Public Function AnalyseIS(ZoneIS As Range)
     
    Dim tab_Pfcst(8) As Single, tab_Pact(8) As Single, tab_Pvar(8) As Single, tab_OPfcst(7) As Single, tab_OPact(7) As Single, tab_OPvar(7) As Single, xa As Double, xc As Integer
    Dim monthS As String, yearS As Integer, typeS As String, i As Long, j As Long, k As Long
    Dim MonGraphe As ChartObject, cumulP As Single, cumulOP As Single
     
    monthS = sh_Actual.ComboBox1.Value
    yearS = sh_Actual.ComboBox2.Value
    typeS = sh_Actual.ComboBox3.Value
     
    '---------------- Recherche la colonne contenant mon annee ------------------------------------------------------------------------------------
     
    xa = WorksheetFunction.Match(sh_Actual.ComboBox2.Value, sh_Actual.Rows(8))
     
    '---------------- me donne le numero du mois dans l'annee deduit du chiffre 1, ex avril = 4 - 1 = 3 --------------------------------------------
     
    For i = 1 To sh_Data.Cells(1, 1).End(xlDown).Row
        Select Case monthS
            Case sh_Data.Cells(i, 1)
                xc = i - 1
        End Select
    Next i
     
    '---------------- Dans cette partie je definis mes tableaux variables qui vont me servir pour mes series dans mon graphique en fonction des valeurs dans mes ComboBox --------
     
    For i = 1 To sh_Data.Cells(1, 3).End(xlDown).Row
     
        Select Case typeS
     
            Case sh_Data.Cells(i, 3)
     
                    tab_Pfcst(0) = sh_Actual.Cells(22, xa + 3 * xc) - sh_Actual.Cells(22, xa + 3 * xc + Int(Abs(Cos(i * 2 / 3)) * 2) + 1)
                    tab_Pact(0) = 0
     
                For j = 1 To UBound(tab_Pfcst) - 1
     
                    tab_Pfcst(j) = sh_Actual.Cells(22 + j, xa + 3 * xc + Int(Abs(Cos(i * 2 / 3)) * 2) + 1) - Int(i / 3) * sh_Actual.Cells(22 + j, xa + 3 * xc + 2)
                    cumulP = 0
                        For k = 0 To j - 1
                            cumulP = cumulP + tab_Pfcst(k)
                        Next k
     
                    If tab_Pfcst(j) < 0 Then
                            tab_Pact(j) = cumulP + tab_Pfcst(j)
                        Else
                            tab_Pact(j) = cumulP
                    End If
     
                Next j
     
                    tab_Pfcst(UBound(tab_Pfcst)) = 0
                    tab_Pact(UBound(tab_Pact)) = sh_Actual.Cells(22, xa + 3 * xc) - Int(i / 3) * sh_Actual.Cells(22, xa + 3 * xc + 2)
     
                    For k = 0 To UBound(tab_Pfcst)
                        tab_Pvar(k) = Abs(tab_Pfcst(k))
                    Next k
     
     
     
     
                    tab_OPfcst(0) = sh_Actual.Cells(33, xa + 3 * xc) - sh_Actual.Cells(33, xa + 3 * xc + Int(Abs(Cos(i * 2 / 3)) * 2) + 1)
                    tab_OPact(0) = 0
     
                    tab_OPfcst(1) = sh_Actual.Cells(17, xa + 3 * xc + Int(Abs(Cos(i * 2 / 3)) * 2) + 1) - Int(i / 3) * Cells(17, xa + 3 * xc + 2)
                        cumulOP = tab_OPfcst(0)
                            If tab_OPfcst(1) < 0 Then
                                tab_OPact(1) = cumulOP + tab_OPfcst(1)
                            Else
                                tab_OPact(1) = cumulOP
                            End If
     
                    cumulOP = tab_OPfcst(0) + tab_OPfcst(1)
     
                For j = 0 To 2
     
                    tab_OPfcst(j + 2) = sh_Actual.Cells(18 + j, xa + 3 * xc + Int(Abs(Cos(i * 2 / 3)) * 2) + 1) - Int(i / 3) * sh_Actual.Cells(18 + j, xa + 3 * xc + 2)
                   'cumulOP = tab_OPfcst(0) + tab_OPfcst(1)
                        'For k = 0 To 2
                            'cumulOP = cumulOP - Int(k / 2 + 1 / 2) * tab_OPfcst(k + 1)
                        'Next k
                        If tab_OPfcst(j + 2) < 0 Then
                                tab_OPact(j + 2) = cumulOP
                            Else
                                tab_OPact(j + 2) = cumulOP - tab_OPfcst(j + 2)
                        End If
     
                    cumulOP = cumulOP - tab_OPfcst(j + 2)
     
                Next j
     
                    tab_OPfcst(5) = sh_Actual.Cells(22, xa + 3 * xc + Int(Abs(Cos(i * 2 / 3)) * 2) + 1) - Int(i / 3) * sh_Actual.Cells(22, xa + 3 * xc + 2)
                        If tab_OPfcst(5) < 0 Then
                                tab_OPact(5) = cumulOP
                            Else
                                tab_OPact(5) = cumulOP - tab_OPfcst(5)
                            End If
     
                    tab_OPfcst(6) = sh_Actual.Cells(31, xa + 3 * xc + Int(Abs(Cos(i * 2 / 3)) * 2) + 1) - Int(i / 3) * sh_Actual.Cells(31, xa + 3 * xc + 2)
                        cumulOP = cumulOP - tab_OPfcst(5)
                            If tab_OPfcst(6) < 0 Then
                                    tab_OPact(6) = cumulOP
                                Else
                                    tab_OPact(6) = cumulOP - tab_OPfcst(6)
                                End If
     
                    tab_OPfcst(UBound(tab_OPfcst)) = 0
                    tab_OPact(UBound(tab_OPact)) = sh_Actual.Cells(33, xa + 3 * xc) - Int(i / 3) * sh_Actual.Cells(33, xa + 3 * xc + 2)
     
                    For k = 0 To UBound(tab_OPfcst)
                        tab_OPvar(k) = Abs(tab_OPfcst(k))
                    Next k
     
     
     
             Case Else
     
        End Select
     
    Next i
     
     
    '------------------- ici je realise ma mise en forme conditionnelle, en fonction des valeurs de mes tableaux variables qui servent series pour mon graph ---------------
     
    sh_Actual.Activate
    Set MonGraphe = sh_Actual.ChartObjects(1)
     
     
            With Range(Cells(58, 3), Cells(62, 4))
                With .Borders(xlEdgeLeft)
                    .LineStyle = xlContinuous
                    .ThemeColor = 1
                    .TintAndShade = 0
                    .Weight = xlThin
                End With
                With .Borders(xlEdgeTop)
                    .LineStyle = xlContinuous
                    .ThemeColor = 1
                    .TintAndShade = 0
                    .Weight = xlThin
                End With
                With .Borders(xlEdgeRight)
                    .LineStyle = xlContinuous
                    .Color = -395791
                    .TintAndShade = 0
                    .Weight = xlThin
                End With
                With .Borders(xlEdgeBottom)
                    .LineStyle = xlContinuous
                    .Color = -395791
                    .TintAndShade = 0
                    .Weight = xlThin
                End With
                With .Borders(xlInsideHorizontal)
                    .LineStyle = xlContinuous
                    .ThemeColor = 1
                    .TintAndShade = 0
                    .Weight = xlThin
                End With
            End With
     
            With Range(Cells(58, 3), Cells(62, 3)).Borders(xlEdgeRight)
                .LineStyle = xlContinuous
                .ThemeColor = 1
                .TintAndShade = 0
                .Weight = xlThin
            End With
     
    If ZoneIS.Value = sh_Actual.Cells(58, 3) Then
     
            MonGraphe.Activate
                With ActiveChart
                    .SeriesCollection(1).Values = tab_OPact
                    .SeriesCollection(2).Values = tab_OPvar
                    .SeriesCollection(1).XValues = "={""OP fcst"",""Net Sales"",""Frt"",""Pckg"",""Mat"",""Proc Cost"",""(to)/from"",""OP act""}"
                    With .SeriesCollection(2).Points(1).Format
                        With .Fill 'BLEU
                            .Visible = msoTrue
                            .ForeColor.ObjectThemeColor = msoThemeColorAccent1
                            .ForeColor.TintAndShade = 0
                            .ForeColor.Brightness = 0.400000006
                            .Transparency = 0
                            .Solid
                        End With
                        With .Line 'BLEU FONCE
                            .Visible = msoTrue
                            .ForeColor.ObjectThemeColor = msoThemeColorAccent1
                            .ForeColor.TintAndShade = 0
                            .ForeColor.Brightness = -0.25
                            .Transparency = 0
                        End With
                    End With
                    With .SeriesCollection(1).Points(2).Format
                    .Fill.Visible = msoFalse
                    .Line.Visible = msoFalse
                    End With
                End With
     
            If tab_OPfcst(1) < 0 Then
                    With ActiveChart.SeriesCollection(2).Points(2).Format
                        With .Fill 'ROUGE
                            .Visible = msoTrue
                            .ForeColor.ObjectThemeColor = msoThemeColorAccent2
                            .ForeColor.TintAndShade = 0
                            .ForeColor.Brightness = 0.400000006
                            .Transparency = 0
                            .Solid
                        End With
                        With .Line 'ROUGE FONCE
                            .Visible = msoTrue
                            .ForeColor.ObjectThemeColor = msoThemeColorAccent2
                            .ForeColor.TintAndShade = 0
                            .ForeColor.Brightness = -0.25
                            .Transparency = 0
                        End With
                    End With
                Else
                    With ActiveChart.SeriesCollection(2).Points(2).Format
                        With .Fill 'VERT
                            .Visible = msoTrue
                            .ForeColor.ObjectThemeColor = msoThemeColorAccent3
                            .ForeColor.TintAndShade = 0
                            .ForeColor.Brightness = 0.400000006
                            .Transparency = 0
                        End With
                        With .Line 'VERT FONCE
                            .Visible = msoTrue
                            .ForeColor.ObjectThemeColor = msoThemeColorAccent3
                            .ForeColor.TintAndShade = 0
                            .ForeColor.Brightness = -0.25
                            .Transparency = 0
                        End With
                    End With
            End If
     
            For i = 3 To UBound(tab_OPvar)
     
                With ActiveChart.SeriesCollection(1).Points(i).Format
                    .Fill.Visible = msoFalse
                    .Line.Visible = msoFalse
                End With
     
                If tab_OPfcst(i - 1) < 0 Then
                    With ActiveChart.SeriesCollection(2).Points(i).Format
                        With .Fill 'VERT
                            .Visible = msoTrue
                            .ForeColor.ObjectThemeColor = msoThemeColorAccent3
                            .ForeColor.TintAndShade = 0
                            .ForeColor.Brightness = 0.400000006
                            .Transparency = 0
                        End With
                        With .Line 'VERT FONCE
                            .Visible = msoTrue
                            .ForeColor.ObjectThemeColor = msoThemeColorAccent3
                            .ForeColor.TintAndShade = 0
                            .ForeColor.Brightness = -0.25
                            .Transparency = 0
                        End With
                    End With
                Else
                    With ActiveChart.SeriesCollection(2).Points(i).Format
                        With .Fill 'ROUGE
                            .Visible = msoTrue
                            .ForeColor.ObjectThemeColor = msoThemeColorAccent2
                            .ForeColor.TintAndShade = 0
                            .ForeColor.Brightness = 0.400000006
                            .Transparency = 0
                            .Solid
                        End With
                        With .Line 'ROUGE FONCE
                            .Visible = msoTrue
                            .ForeColor.ObjectThemeColor = msoThemeColorAccent2
                            .ForeColor.TintAndShade = 0
                            .ForeColor.Brightness = -0.25
                            .Transparency = 0
                        End With
                    End With
     
                End If
            Next i
     
            With ActiveChart.SeriesCollection(1).Points(UBound(tab_OPvar) + 1).Format
                With .Fill 'BLEU
                    .Visible = msoTrue
                    .ForeColor.ObjectThemeColor = msoThemeColorAccent1
                    .ForeColor.TintAndShade = 0
                    .ForeColor.Brightness = 0.400000006
                    .Transparency = 0
                    .Solid
                End With
                With .Line 'BLEU FONCE
                    .Visible = msoTrue
                    .ForeColor.ObjectThemeColor = msoThemeColorAccent1
                    .ForeColor.TintAndShade = 0
                    .ForeColor.Brightness = -0.25
                    .Transparency = 0
                End With
            End With
     
     
            Range(Cells(58, 3), Cells(58, 4)).Interior.Color = RGB(241, 245, 249)
            Range(Cells(59, 3), Cells(62, 3)).Interior.Color = RGB(255, 255, 255)
            Range(Cells(59, 4), Cells(62, 4)).Interior.Color = RGB(242, 242, 242)
     
            With Range(Cells(58, 3), Cells(58, 3)).Borders(xlEdgeLeft)
                .LineStyle = xlContinuous
                .ThemeColor = 5
                .TintAndShade = -0.249946592608417
                .Weight = xlThin
            End With
            With Range(Cells(58, 3), Cells(58, 4)).Borders(xlEdgeTop)
                .LineStyle = xlContinuous
                .ThemeColor = 5
                .TintAndShade = -0.249946592608417
                .Weight = xlThin
            End With
            With Range(Cells(58, 3), Cells(58, 3)).Borders(xlEdgeRight)
                .LineStyle = xlContinuous
                .Color = -395791
                .TintAndShade = 0
                .Weight = xlThin
            End With
            With Range(Cells(58, 3), Cells(58, 3)).Borders(xlEdgeBottom)
                .LineStyle = xlContinuous
                .ThemeColor = 5
                .TintAndShade = -0.249946592608417
                .Weight = xlThin
            End With
            With Range(Cells(59, 3), Cells(62, 3)).Borders(xlEdgeRight)
                .LineStyle = xlContinuous
                .ThemeColor = 5
                .TintAndShade = -0.249946592608417
                .Weight = xlThin
            End With
            With Range(Cells(62, 4), Cells(62, 4)).Borders(xlEdgeBottom)
                .LineStyle = xlContinuous
                .ThemeColor = 5
                .TintAndShade = -0.249946592608417
                .Weight = xlThin
            End With
     
     
            Range(Cells(59, 3), Cells(62, 3)).Borders(xlEdgeLeft).LineStyle = xlNone
     
     
        Else
     
     
     
            MonGraphe.Activate
                With ActiveChart
                    .SeriesCollection(1).Values = tab_Pact
                    .SeriesCollection(2).Values = tab_Pvar
                    .SeriesCollection(1).XValues = "={""PC fcst"",""Empl"",""F.Energy"",""Atm"",""Util"",""Dep & Am"",""M.Rep & Sup"",""Others"",""PC act""}"
                    With .SeriesCollection(2).Points(1).Format
                        With .Fill 'BLEU
                            .Visible = msoTrue
                            .ForeColor.ObjectThemeColor = msoThemeColorAccent1
                            .ForeColor.TintAndShade = 0
                            .ForeColor.Brightness = 0.400000006
                            .Transparency = 0
                            .Solid
                        End With
                        With .Line 'BLEU FONCE
                            .Visible = msoTrue
                            .ForeColor.ObjectThemeColor = msoThemeColorAccent1
                            .ForeColor.TintAndShade = 0
                            .ForeColor.Brightness = -0.25
                            .Transparency = 0
                        End With
                    End With
     
                End With
     
     
            For i = 2 To UBound(tab_Pvar)
     
                With ActiveChart.SeriesCollection(1).Points(i).Format
                    .Fill.Visible = msoFalse
                    .Line.Visible = msoFalse
                End With
     
                If tab_Pfcst(i - 1) < 0 Then
                    With ActiveChart.SeriesCollection(2).Points(i).Format
                        With .Fill 'VERT
                            .Visible = msoTrue
                            .ForeColor.ObjectThemeColor = msoThemeColorAccent3
                            .ForeColor.TintAndShade = 0
                            .ForeColor.Brightness = 0.400000006
                            .Transparency = 0
                        End With
                        With .Line 'VERT FONCE
                            .Visible = msoTrue
                            .ForeColor.ObjectThemeColor = msoThemeColorAccent3
                            .ForeColor.TintAndShade = 0
                            .ForeColor.Brightness = -0.25
                            .Transparency = 0
                        End With
                    End With
                Else
                    With ActiveChart.SeriesCollection(2).Points(i).Format
                        With .Fill 'ROUGE
                            .Visible = msoTrue
                            .ForeColor.ObjectThemeColor = msoThemeColorAccent2
                            .ForeColor.TintAndShade = 0
                            .ForeColor.Brightness = 0.400000006
                            .Transparency = 0
                            .Solid
                        End With
                        With .Line 'ROUGE FONCE
                            .Visible = msoTrue
                            .ForeColor.ObjectThemeColor = msoThemeColorAccent2
                            .ForeColor.TintAndShade = 0
                            .ForeColor.Brightness = -0.25
                            .Transparency = 0
                        End With
                    End With
     
                End If
            Next i
     
     
     
            With ActiveChart.SeriesCollection(1).Points(UBound(tab_Pvar) + 1).Format
                With .Fill 'BLEU
                    .Visible = msoTrue
                    .ForeColor.ObjectThemeColor = msoThemeColorAccent1
                    .ForeColor.TintAndShade = 0
                    .ForeColor.Brightness = 0.400000006
                    .Transparency = 0
                    .Solid
                End With
                With .Line 'BLEU FONCE
                    .Visible = msoTrue
                    .ForeColor.ObjectThemeColor = msoThemeColorAccent1
                    .ForeColor.TintAndShade = 0
                    .ForeColor.Brightness = -0.25
                    .Transparency = 0
                End With
            End With
     
     
            Range(Cells(62, 3), Cells(62, 4)).Interior.Color = RGB(241, 245, 249)
            Range(Cells(58, 3), Cells(61, 3)).Interior.Color = RGB(255, 255, 255)
            Range(Cells(58, 4), Cells(61, 4)).Interior.Color = RGB(242, 242, 242)
     
            With Range(Cells(62, 3), Cells(62, 3)).Borders(xlEdgeLeft)
                .LineStyle = xlContinuous
                .ThemeColor = 5
                .TintAndShade = -0.249946592608417
                .Weight = xlThin
            End With
            With Range(Cells(62, 3), Cells(62, 3)).Borders(xlEdgeTop)
                .LineStyle = xlContinuous
                .ThemeColor = 5
                .TintAndShade = -0.249946592608417
                .Weight = xlThin
            End With
            With Range(Cells(62, 3), Cells(62, 3)).Borders(xlEdgeRight)
                .LineStyle = xlContinuous
                .Color = -395791
                .TintAndShade = 0
                .Weight = xlThin
            End With
            With Range(Cells(62, 3), Cells(62, 4)).Borders(xlEdgeBottom)
                .LineStyle = xlContinuous
                .ThemeColor = 5
                .TintAndShade = -0.249946592608417
                .Weight = xlThin
            End With
            With Range(Cells(58, 4), Cells(61, 4)).Borders(xlEdgeLeft)
                .LineStyle = xlContinuous
                .ThemeColor = 5
                .TintAndShade = -0.249946592608417
                .Weight = xlThin
            End With
            With Range(Cells(58, 4), Cells(58, 4)).Borders(xlEdgeTop)
                .LineStyle = xlContinuous
                .ThemeColor = 5
                .TintAndShade = -0.249946592608417
                .Weight = xlThin
            End With
     
     
     
    End If
     
    '------------- ici ma tentative de deselectionner mon graph ----------------------------------------------------
     
    ActiveChart.Deselect
    sh_Actual.Cells(1, 1).Select
     
    End Function
    Fichiers attachés Fichiers attachés

  6. #6
    Expert éminent Avatar de Menhir
    Homme Profil pro
    Ingénieur
    Inscrit en
    Juin 2007
    Messages
    16 037
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Finistère (Bretagne)

    Informations professionnelles :
    Activité : Ingénieur
    Secteur : Industrie

    Informations forums :
    Inscription : Juin 2007
    Messages : 16 037
    Par défaut
    Peut-être que tu ne vois pas le problème sous le bon angle. Peut-être que ton graphe est effectivement déselectionné mais se resélectionne immédiatement.

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

Discussions similaires

  1. Formalisation graphique des algorithmes
    Par David R. dans le forum Algorithmes et structures de données
    Réponses: 14
    Dernier message: 08/12/2012, 10h21
  2. Développement de plug-in -> vue graphique!
    Par yassine_23 dans le forum Eclipse Platform
    Réponses: 3
    Dernier message: 01/04/2003, 18h04
  3. Réponses: 3
    Dernier message: 09/02/2003, 01h09
  4. [RAVE][DELPHI7] Comment faire un graphique ?
    Par DFANDOR dans le forum Rave
    Réponses: 7
    Dernier message: 06/02/2003, 20h25
  5. Réponses: 10
    Dernier message: 27/08/2002, 23h24

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