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 :

Problème vba tableau dynamique


Sujet :

Macros et VBA Excel

Vue hybride

Message précédent Message précédent   Message suivant Message suivant
  1. #1
    Membre averti
    Homme Profil pro
    Urbaniste
    Inscrit en
    Juin 2021
    Messages
    14
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 48
    Localisation : France, Manche (Basse Normandie)

    Informations professionnelles :
    Activité : Urbaniste

    Informations forums :
    Inscription : Juin 2021
    Messages : 14
    Par défaut Problème vba tableau dynamique
    Bonjour

    J'ai un problème j'ai un inventaire lorsque je fais un ajout avec le Bt ajouter un article
    l'ajout ne va pas dans le tableau dynamique il va à la ligne suivante et comment fait pour après mon ajout ou un nouvel article cela se met par ordre alphabétique automatiquement
    UserForm1 = ajout
    UserForm2 = modifier
    module14 15 16
    merci
    Fichiers attachés Fichiers attachés

  2. #2
    Membre chevronné
    Homme Profil pro
    Ingénieur qualité méthodes
    Inscrit en
    Mars 2021
    Messages
    334
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Rhône (Rhône Alpes)

    Informations professionnelles :
    Activité : Ingénieur qualité méthodes
    Secteur : Industrie

    Informations forums :
    Inscription : Mars 2021
    Messages : 334
    Par défaut
    Salut, tu as déjà des colonnes filtrée, voila ce que j'obtiens avec l'enregistreur de macro :

    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
    Sub Macro1()
    '
    ' Macro1 Macro
    '
     
    '
        ActiveWorkbook.Worksheets("Catalogue").ListObjects("Tableau5").Sort.SortFields. _
            Clear
        ActiveWorkbook.Worksheets("Catalogue").ListObjects("Tableau5").Sort.SortFields. _
            Add2 Key:=Range("Tableau5[[#All],[Article]]"), SortOn:=xlSortOnValues, _
            Order:=xlAscending, DataOption:=xlSortNormal
        With ActiveWorkbook.Worksheets("Catalogue").ListObjects("Tableau5").Sort
            .Header = xlYes
            .MatchCase = False
            .Orientation = xlTopToBottom
            .SortMethod = xlPinYin
            .Apply
        End With
     
    End Sub
    Ça filtre les articles de A a Z, tu peux faire un call à cette macro après avoir inséré ton nouvel article.

  3. #3
    Membre averti
    Homme Profil pro
    Urbaniste
    Inscrit en
    Juin 2021
    Messages
    14
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 48
    Localisation : France, Manche (Basse Normandie)

    Informations professionnelles :
    Activité : Urbaniste

    Informations forums :
    Inscription : Juin 2021
    Messages : 14
    Par défaut
    merci de ta réponse
    tu me dis de faire un call à cette macro après avoir inséré ton nouvel article.

    mon module 15

    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
    Sub recherche()
    'rechercher dans la feuil catalogue, le contenu de la feuil gestion rangé I10
    Application.ScreenUpdating = False
    Sheets("Catalogue").Select
    Dim Cellule As Range
    Set Cellule = Range("A:A").Find(what:=Sheets("Gestionnaire du magasin").Range("I10").Value, LookIn:=xlValues, lookat:=xlWhole)
    If Not Cellule Is Nothing Then Cells(Cellule.Row, Cellule.Column).Select
     
     
    ActiveCell.Select
    ActiveCell = UserForm2.TextBox11.Value
     
    ' on ajoute a la commande  ''Bt ajout''
    ActiveCell.Offset(0, 2) = ActiveCell.Offset(0, 2) + UserForm2.TextBox2.Value
     
     
    '''''''''''''''''''''''''''On additionne chaque sortie de stock-sortie_magasin ''''''''''''''''
    ActiveCell.Offset(0, 4) = ActiveCell.Offset(0, 4) + Val(UserForm2.TextBox4.Value)
     
     
    Sheets("gestionnaire du magasin").Select
    Application.ScreenUpdating = True
    MsgBox "Modification Effectuer!"
    Unload UserForm2
     
    End Sub
    -------------------------------
    Sub Macro30()
    '
    ' Macro30 Macro
    '
     
    '
        ActiveWorkbook.Worksheets("Catalogue").ListObjects("Tableau5").Sort.SortFields. _
            Clear
        ActiveWorkbook.Worksheets("Catalogue").ListObjects("Tableau5").Sort.SortFields. _
            Add2 Key:=Range("Tableau5[[#All],[Article]]"), SortOn:=xlSortOnValues, _
            Order:=xlAscending, DataOption:=xlSortNormal
        With ActiveWorkbook.Worksheets("Catalogue").ListObjects("Tableau5").Sort
            .Header = xlYes
            .MatchCase = False
            .Orientation = xlTopToBottom
            .SortMethod = xlPinYin
            .Apply
        End With
     
    End Sub
    Ça ne marche pas je ne sais pas où le déposer merci

  4. #4
    Membre chevronné
    Homme Profil pro
    Ingénieur qualité méthodes
    Inscrit en
    Mars 2021
    Messages
    334
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Rhône (Rhône Alpes)

    Informations professionnelles :
    Activité : Ingénieur qualité méthodes
    Secteur : Industrie

    Informations forums :
    Inscription : Mars 2021
    Messages : 334
    Par défaut
    Dans ta macro "recherche" tu ajoute après avoir fais ta mise a jour un :

    comme ceci :

    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
    Sub recherche()
    'rechercher dans la feuil catalogue, le contenu de la feuil gestion rangé I10
    Application.ScreenUpdating = False
    Sheets("Catalogue").Select
    Dim Cellule As Range
    Set Cellule = Range("A:A").Find(what:=Sheets("Gestionnaire du magasin").Range("I10").Value, LookIn:=xlValues, lookat:=xlWhole)
    If Not Cellule Is Nothing Then Cells(Cellule.Row, Cellule.Column).Select
     
     
    ActiveCell.Select
    ActiveCell = UserForm2.TextBox11.Value
     
    ' on ajoute a la commande  ''Bt ajout''
    ActiveCell.Offset(0, 2) = ActiveCell.Offset(0, 2) + UserForm2.TextBox2.Value
     
     
    '''''''''''''''''''''''''''On additionne chaque sortie de stock-sortie_magasin ''''''''''''''''
    ActiveCell.Offset(0, 4) = ActiveCell.Offset(0, 4) + Val(UserForm2.TextBox4.Value)
     
     call macro30
     
    Sheets("gestionnaire du magasin").Select
    Application.ScreenUpdating = True
    MsgBox "Modification Effectuer!"
    Unload UserForm2
     
    End Sub

  5. #5
    Membre averti
    Homme Profil pro
    Urbaniste
    Inscrit en
    Juin 2021
    Messages
    14
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 48
    Localisation : France, Manche (Basse Normandie)

    Informations professionnelles :
    Activité : Urbaniste

    Informations forums :
    Inscription : Juin 2021
    Messages : 14
    Par défaut
    Merci mais il y a une erreur lorsque je veut faire une modification

    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
    Sub Macro30()
    '
    ' Macro1 Macro
    '
     
    '
        ActiveWorkbook.Worksheets("Catalogue").ListObjects("Tableau5").Sort.SortFields. _
            Clear
        ActiveWorkbook.Worksheets("Catalogue").ListObjects("Tableau5").Sort.SortFields. _       erreur
            Add2 Key:=Range("Tableau5[[#All],[Article]]"), SortOn:=xlSortOnValues, _               erreur
            Order:=xlAscending, DataOption:=xlSortNormal[/COLOR]                                        erreur
        With ActiveWorkbook.Worksheets("Catalogue").ListObjects("Tableau5").Sort[/COLOR]
            .Header = xlYes
            .MatchCase = False
            .Orientation = xlTopToBottom
            .SortMethod = xlPinYin
            .Apply
        End With
     
    End Sub
    et l'ajout ne va pas dans mon tableau !!

  6. #6
    Membre chevronné
    Homme Profil pro
    Ingénieur qualité méthodes
    Inscrit en
    Mars 2021
    Messages
    334
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Rhône (Rhône Alpes)

    Informations professionnelles :
    Activité : Ingénieur qualité méthodes
    Secteur : Industrie

    Informations forums :
    Inscription : Mars 2021
    Messages : 334
    Par défaut
    Je n'ai pas compris

Discussions similaires

  1. Problème de tableau dynamique d'objets
    Par markfish55 dans le forum C++
    Réponses: 2
    Dernier message: 07/06/2008, 13h07
  2. Problème de tableau dynamique en paramètre
    Par sapin dans le forum Langage
    Réponses: 2
    Dernier message: 11/04/2008, 14h33
  3. problème allocation tableau dynamique
    Par ofinot dans le forum C++
    Réponses: 5
    Dernier message: 12/02/2008, 15h03
  4. Problème de tableau dynamique
    Par Vindz dans le forum LabVIEW
    Réponses: 23
    Dernier message: 26/04/2007, 13h27
  5. problème avec tableau dynamique
    Par akrobat dans le forum C++
    Réponses: 7
    Dernier message: 28/04/2006, 15h29

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