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 :

Bouton permettant d'obtenir le graphe de deux TDC déjà réalisés


Sujet :

Macros et VBA Excel

  1. #1
    Membre à l'essai
    Femme Profil pro
    Étudiant
    Inscrit en
    Août 2014
    Messages
    17
    Détails du profil
    Informations personnelles :
    Sexe : Femme
    Localisation : France, Calvados (Basse Normandie)

    Informations professionnelles :
    Activité : Étudiant

    Informations forums :
    Inscription : Août 2014
    Messages : 17
    Points : 13
    Points
    13
    Par défaut Bouton permettant d'obtenir le graphe de deux TDC déjà réalisés
    Bonjour,

    j'ai un tableau de suivi avec deux TDC.
    je souhaiterai qu'un troisième voir quatrième bouton créé puisse générer les graphiques des TDC.

    je souhaiterai poster mon fichier excel pour ce cas mais celà fait 292 ko en zip.

    Existe t-il une solution pour le mette?

    D'avance Merci


    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
    Sub Graphe()
     
    Sheets("Suivi PIQ").Select
        Range("A1").Select
    Sheets.Add
    ActiveSheet.Name = "PIQ"
        ActiveWorkbook.PivotCaches.Create(SourceType:=xlDatabase, SourceData:= _
            "Suivi PIQ!R1C1:R21C15", Version:=xlPivotTableVersion15).CreatePivotTable _
            TableDestination:="Graphe!R3C1", TableName:="Tableau croisé dynamique3", _
            DefaultVersion:=xlPivotTableVersion15
     
        With ActiveSheet.PivotTables("Tableau croisé dynamique3").PivotFields("Id PA")
            .Orientation = xlRowField
            .Position = 1
        End With
        With ActiveSheet.PivotTables("Tableau croisé dynamique3").PivotFields( _
            "Code IMB")
            .Orientation = xlRowField
            .Position = 2
        End With
        ActiveSheet.PivotTables("Tableau croisé dynamique3").AddDataField ActiveSheet. _
            PivotTables("Tableau croisé dynamique3").PivotFields("Nb d'EL"), _
            "Somme de Nb d'EL", xlSum
     
    End Sub

    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
    Sub CreerTCDH()
     
    Sheets("HAVRE-Lot 1").Select
        Range("A1").Select
    Sheets.Add
    ActiveSheet.Name = "TCDH"
        ActiveWorkbook.PivotCaches.Create(SourceType:=xlDatabase, SourceData:= _
            "HAVRE-Lot 1!R1C1:R34C10", Version:=xlPivotTableVersion15).CreatePivotTable _
            TableDestination:="TCDH!R3C1", TableName:="Tableau croisé dynamique3", _
            DefaultVersion:=xlPivotTableVersion15
             With ActiveSheet.PivotTables("Tableau croisé dynamique3").PivotFields( _
            "Num Activité")
            .Orientation = xlRowField
            .Position = 1
        End With
        With ActiveSheet.PivotTables("Tableau croisé dynamique3").PivotFields("Id PA")
            .Orientation = xlRowField
            .Position = 2
        End With
        With ActiveSheet.PivotTables("Tableau croisé dynamique3").PivotFields( _
            "Code IMB")
            .Orientation = xlRowField
            .Position = 3
        End With
        ActiveSheet.PivotTables("Tableau croisé dynamique3").AddDataField ActiveSheet. _
            PivotTables("Tableau croisé dynamique3").PivotFields("Nb de  lgmt"), _
            "Somme de Nb de  lgmt", xlSum
    End Sub
    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
    Sub Macro1()
    '
    ' Macro1 Macro
    '
     
    '
        Sheets("HAVRE-Lot 1").Select
        Range("B20").Select
        Sheets.Add
        ActiveWorkbook.Worksheets("TDCHAVRE").PivotTables("Tableau croisé dynamique1"). _
            PivotCache.CreatePivotTable TableDestination:="Feuil2!R3C1", TableName:= _
            "Tableau croisé dynamique2", DefaultVersion:=xlPivotTableVersion15
        Sheets("Feuil2").Select
        Cells(3, 1).Select
        ActiveWindow.SmallScroll Down:=-9
    End Sub
    Sub Macro2()
    '
    ' Macro2 Macro
    '
     
    '
        Range("C11").Select
        ActiveSheet.PivotTables("Tableau croisé dynamique2").AddDataField ActiveSheet. _
            PivotTables("Tableau croisé dynamique2").PivotFields("Nb de  lgmt"), _
            "Somme de Nb de  lgmt", xlSum
        With ActiveSheet.PivotTables("Tableau croisé dynamique2").PivotFields( _
            "Code IMB")
            .Orientation = xlRowField
            .Position = 1
        End With
        ActiveSheet.PivotTables("Tableau croisé dynamique2").PivotFields("Code IMB"). _
            Orientation = xlHidden
        ActiveWindow.SmallScroll Down:=-12
    End Sub
    Sub Macro3()
    '
    ' Macro3 Macro
    '
     
    '
        Sheets("HAVRE-Lot 1").Select
        Range("A1").Select
        Sheets.Add
        ActiveWorkbook.Worksheets("TDCHAVRE").PivotTables("Tableau croisé dynamique1"). _
            PivotCache.CreatePivotTable TableDestination:="Feuil3!R3C1", TableName:= _
            "Tableau croisé dynamique3", DefaultVersion:=xlPivotTableVersion15
        Sheets("Feuil3").Select
        Cells(3, 1).Select
        Sheets("Feuil3").Select
        Sheets("Feuil3").Name = "TCDHAVRE"
        With ActiveSheet.PivotTables("Tableau croisé dynamique3").PivotFields( _
            "Num Activité")
            .Orientation = xlRowField
            .Position = 1
        End With
        With ActiveSheet.PivotTables("Tableau croisé dynamique3").PivotFields("Id PA")
            .Orientation = xlRowField
            .Position = 2
        End With
        With ActiveSheet.PivotTables("Tableau croisé dynamique3").PivotFields( _
            "Code IMB")
            .Orientation = xlRowField
            .Position = 3
        End With
        ActiveSheet.PivotTables("Tableau croisé dynamique3").AddDataField ActiveSheet. _
            PivotTables("Tableau croisé dynamique3").PivotFields("Nb de  lgmt"), _
            "Somme de Nb de  lgmt", xlSum
        ActiveWindow.SmallScroll ToRight:=0
    End Sub
    Sub Macro4()
    '
    ' Macro4 Macro
    '
     
    '
        Range("A1").Select
        Sheets.Add
        ActiveWorkbook.PivotCaches.Create(SourceType:=xlDatabase, SourceData:= _
            "HAVRE-Lot 1!R1C1:R35C10", Version:=xlPivotTableVersion15).CreatePivotTable _
            TableDestination:="Feuil10!R3C1", TableName:="Tableau croisé dynamique4", _
            DefaultVersion:=xlPivotTableVersion15
        Sheets("Feuil10").Select
        Cells(3, 1).Select
    End Sub

    D'avance MERCI

  2. #2
    Membre du Club
    Homme Profil pro
    Analyse système
    Inscrit en
    Mai 2014
    Messages
    35
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Val de Marne (Île de France)

    Informations professionnelles :
    Activité : Analyse système

    Informations forums :
    Inscription : Mai 2014
    Messages : 35
    Points : 51
    Points
    51
    Par défaut
    Bonjour,

    Bonton permettant d'obtenir le graphe de deux TDC déjà réalisés
    Quel rapport avec le titre?

  3. #3
    Membre à l'essai
    Femme Profil pro
    Étudiant
    Inscrit en
    Août 2014
    Messages
    17
    Détails du profil
    Informations personnelles :
    Sexe : Femme
    Localisation : France, Calvados (Basse Normandie)

    Informations professionnelles :
    Activité : Étudiant

    Informations forums :
    Inscription : Août 2014
    Messages : 17
    Points : 13
    Points
    13
    Par défaut
    C'est pour éviter de créer deux sujets que j'ai fait ça de ce faite je mets le fichier excel ici et mon problème

  4. #4
    Membre averti
    Homme Profil pro
    Étudiant
    Inscrit en
    Juin 2014
    Messages
    271
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Nord (Nord Pas de Calais)

    Informations professionnelles :
    Activité : Étudiant
    Secteur : Finance

    Informations forums :
    Inscription : Juin 2014
    Messages : 271
    Points : 335
    Points
    335
    Par défaut Enregistreur de macro
    Bonjour,

    Premièrement on ne peut pas t'aider à créer des graphes si on ne sait pas ce que tu veux mettre dedans.

    Deuxièmement, la solution la plus simple est l'enregistreur de macro, comme ça tu pourras construire exactement ce que tu veux.

  5. #5
    Membre à l'essai
    Femme Profil pro
    Étudiant
    Inscrit en
    Août 2014
    Messages
    17
    Détails du profil
    Informations personnelles :
    Sexe : Femme
    Localisation : France, Calvados (Basse Normandie)

    Informations professionnelles :
    Activité : Étudiant

    Informations forums :
    Inscription : Août 2014
    Messages : 17
    Points : 13
    Points
    13
    Par défaut
    J'utilise déjà l'enregistreur de Macro je sais comment ça fonctionne
    Tu as parfaitement raison c'est pour ça je veux mettre la pièce jointe sauf que ça fait plus de 200 ko

  6. #6
    Membre averti
    Homme Profil pro
    Étudiant
    Inscrit en
    Juin 2014
    Messages
    271
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Nord (Nord Pas de Calais)

    Informations professionnelles :
    Activité : Étudiant
    Secteur : Finance

    Informations forums :
    Inscription : Juin 2014
    Messages : 271
    Points : 335
    Points
    335
    Par défaut
    Si il fait plus de 200 KO supprime ce qui est inutile ou extrait tes deux tableaux et les graphiques que tu veux.

    Si tu connais l'enregistreur je ne vois pas où est le problème.

Discussions similaires

  1. afficher deux graphes avec deux boutons
    Par biliesod dans le forum Interfaces Graphiques
    Réponses: 1
    Dernier message: 18/06/2011, 19h08
  2. Algorithme permettant de calculer le PGCD de deux nombres
    Par zeyd dans le forum Algorithmes et structures de données
    Réponses: 2
    Dernier message: 25/11/2005, 20h37
  3. Composant permettant de faire des graphes sous Excel
    Par PrinceMaster77 dans le forum ASP
    Réponses: 2
    Dernier message: 25/10/2005, 22h13
  4. Comment obtenir la différence entre deux dates ?
    Par jbat dans le forum Langage
    Réponses: 4
    Dernier message: 02/06/2005, 09h34
  5. [VC++ 6] Boutons permettant d'afficher une form
    Par cooladn dans le forum MFC
    Réponses: 3
    Dernier message: 09/12/2004, 16h17

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