Ceci est une page optimisée pour les mobiles. Cliquez sur ce texte pour afficher la vraie page.

Taille de fichier (trop lourd)

  • Initiateur de la discussion Initiateur de la discussion poipoi
  • Date de début Date de début

Boostez vos compétences Excel avec notre communauté !

Rejoignez Excel Downloads, le rendez-vous des passionnés où l'entraide fait la force. Apprenez, échangez, progressez – et tout ça gratuitement ! 👉 Inscrivez-vous maintenant !

poipoi

XLDnaute Impliqué
bonjour
voilà je m'attelle à une gestion de stock ce qui est pour moi lune aventure.. mais petit à petit (et avec votre aide de temps en temps!!) je compte bien y parvenir
dans le fichier joint j'ai dû placer un code qui alourdit considérablement la taille du fichier..
et je n'arrive pas à le localiser afin de le supprimer..
pour le fonctionnement des userforms j'ai un petit souci mais je ferai un autre post si besoin

si vous pouvez jeter un petit coup d'oeil.. merci à vous

http://cjoint.com/?0lzpvKMDOxr
 
Re : Taille de fichier (trop lourd)

Bonsoir POIPOI, et tous
Comme je l'ai appris ici, Excel stock et ne met pas systématiquement à jour certains évènements
Avant de retoucher ton fichier j'ai fait la combinaison de touche Ctrl+fin et la dernière cellule trouvée est sur la ligne 65535
J'ai sélectionné de la première ligne vierge dans ton fichier (413) pris je suis allé en 65535 faire un MAJ clique gauche pour tout prendre
ensuite clique droit et supprimer
Ho miracle le fichier retombe à 186K je le joins
Il y a sans doute une solution plus Excel_lente que la mienne mais ça marche
 

Pièces jointes

Re : Taille de fichier (trop lourd)

bonjour gillesdemev, le forum

effectivement cela parait si simple.. mais je ne comprends pas pourquoi ou ce qu'il pouvait y avoir dans ces lignes "vides"..
un grand merci à toi et...
bonne journée
 
Re : Taille de fichier (trop lourd)

Bonsoir Staple1600
C'est sympa de partager cela.. je crois bien que pour l'usine à gaz dans laquelle je me suis lancé ce petit bout de code va m'être bougrement utile...
merci et bonne soirée
 
Re : Taille de fichier (trop lourd)

Salut,
moi j'ai le même problème.
Mon fichier faisait 1 à 2 mo maximum. Là il en fait 11mo et augmente à chaque enregistrement.
Je n'ai pas 65535 lignes. J'ai vérifié.
Code:
Sub Mise_A_Jour()
                       '*************************************************************************
                             '*************************************************************

                             '**************************************************************
                       '*************************************************************************
   
        'Pour info il existe en tout 4 feuilles par secteur dont 3 cachées (pour les stats)
        
        

Dim plage As Range
Dim cel As Range

'___________________________________________________________________________________
'-----------------------------------------------------------------------------------
'Effacer les cellules de chaque feuille (secteur par secteur)
'___________________________________________________________________________________
'-----------------------------------------------------------------------------------

   
    Sheets("MDCcloses").Select
           If Cells(5, 1).End(xlDown).Row > 5 Then
        Range(Cells(6, 1), Cells(Cells(5, 1).End(xlDown).Row, 14)).ClearContents
            End If
'-----------
    Sheets("MDCouvertes").Select
           If Cells(5, 1).End(xlDown).Row > 5 Then
        Range(Cells(6, 1), Cells(Cells(5, 1).End(xlDown).Row, 14)).ClearContents
            End If
'-----------
    Sheets("ActionsCloses").Select
           If Cells(5, 1).End(xlDown).Row > 5 Then
        Range(Cells(6, 1), Cells(Cells(5, 1).End(xlDown).Row, 14)).ClearContents
            End If
'___________
'-----------
    Sheets("AQS").Select
           If Cells(5, 1).End(xlDown).Row > 5 Then
        Range(Cells(6, 1), Cells(Cells(5, 1).End(xlDown).Row, 14)).ClearContents
            End If
'-----------
    Sheets("AQS (2)").Select
           If Cells(5, 1).End(xlDown).Row > 5 Then
        Range(Cells(6, 1), Cells(Cells(5, 1).End(xlDown).Row, 14)).ClearContents
            End If
'-----------
    Sheets("AQS (3)").Select
           If Cells(5, 1).End(xlDown).Row > 5 Then
        Range(Cells(6, 1), Cells(Cells(5, 1).End(xlDown).Row, 14)).ClearContents
            End If
'-----------
    Sheets("AQS (4)").Select
           If Cells(5, 1).End(xlDown).Row > 5 Then
        Range(Cells(6, 1), Cells(Cells(5, 1).End(xlDown).Row, 14)).ClearContents
            End If
'___________
'-----------
    Sheets("AQO").Select
           If Cells(5, 1).End(xlDown).Row > 5 Then
        Range(Cells(6, 1), Cells(Cells(5, 1).End(xlDown).Row, 14)).ClearContents
            End If
'-----------
    Sheets("AQO (2)").Select
           If Cells(5, 1).End(xlDown).Row > 5 Then
        Range(Cells(6, 1), Cells(Cells(5, 1).End(xlDown).Row, 14)).ClearContents
            End If
'-----------
    Sheets("AQO (3)").Select
           If Cells(5, 1).End(xlDown).Row > 5 Then
        Range(Cells(6, 1), Cells(Cells(5, 1).End(xlDown).Row, 14)).ClearContents
            End If
'-----------
    Sheets("AQO (4)").Select
           If Cells(5, 1).End(xlDown).Row > 5 Then
        Range(Cells(6, 1), Cells(Cells(5, 1).End(xlDown).Row, 14)).ClearContents
            End If
'___________
'-----------
    Sheets("EHS").Select
           If Cells(5, 1).End(xlDown).Row > 5 Then
        Range(Cells(6, 1), Cells(Cells(5, 1).End(xlDown).Row, 14)).ClearContents
            End If
'-----------
    Sheets("EHS (2)").Select
           If Cells(5, 1).End(xlDown).Row > 5 Then
        Range(Cells(6, 1), Cells(Cells(5, 1).End(xlDown).Row, 14)).ClearContents
            End If
'-----------
    Sheets("EHS (3)").Select
           If Cells(5, 1).End(xlDown).Row > 5 Then
        Range(Cells(6, 1), Cells(Cells(5, 1).End(xlDown).Row, 14)).ClearContents
            End If
'-----------
    Sheets("EHS (4)").Select
           If Cells(5, 1).End(xlDown).Row > 5 Then
        Range(Cells(6, 1), Cells(Cells(5, 1).End(xlDown).Row, 14)).ClearContents
            End If
'___________
'-----------
    Sheets("REGL").Select
           If Cells(5, 1).End(xlDown).Row > 5 Then
        Range(Cells(6, 1), Cells(Cells(5, 1).End(xlDown).Row, 14)).ClearContents
            End If
'-----------
    Sheets("REGL (2)").Select
           If Cells(5, 1).End(xlDown).Row > 5 Then
        Range(Cells(6, 1), Cells(Cells(5, 1).End(xlDown).Row, 14)).ClearContents
            End If
'-----------
    Sheets("REGL (3)").Select
           If Cells(5, 1).End(xlDown).Row > 5 Then
        Range(Cells(6, 1), Cells(Cells(5, 1).End(xlDown).Row, 14)).ClearContents
            End If
'-----------
    Sheets("REGL (4)").Select
           If Cells(5, 1).End(xlDown).Row > 5 Then
        Range(Cells(6, 1), Cells(Cells(5, 1).End(xlDown).Row, 14)).ClearContents
            End If
'___________
'-----------
    Sheets("INDUS").Select
           If Cells(5, 1).End(xlDown).Row > 5 Then
        Range(Cells(6, 1), Cells(Cells(5, 1).End(xlDown).Row, 14)).ClearContents
            End If
'-----------
    Sheets("INDUS (2)").Select
           If Cells(5, 1).End(xlDown).Row > 5 Then
        Range(Cells(6, 1), Cells(Cells(5, 1).End(xlDown).Row, 14)).ClearContents
            End If
'-----------
    Sheets("INDUS (3)").Select
           If Cells(5, 1).End(xlDown).Row > 5 Then
        Range(Cells(6, 1), Cells(Cells(5, 1).End(xlDown).Row, 14)).ClearContents
            End If
'-----------
    Sheets("INDUS (4)").Select
           If Cells(5, 1).End(xlDown).Row > 5 Then
        Range(Cells(6, 1), Cells(Cells(5, 1).End(xlDown).Row, 14)).ClearContents
            End If
'___________
'-----------
    Sheets("INGE").Select
           If Cells(5, 1).End(xlDown).Row > 5 Then
        Range(Cells(6, 1), Cells(Cells(5, 1).End(xlDown).Row, 14)).ClearContents
            End If
'-----------
    Sheets("INGE (2)").Select
           If Cells(5, 1).End(xlDown).Row > 5 Then
        Range(Cells(6, 1), Cells(Cells(5, 1).End(xlDown).Row, 14)).ClearContents
            End If
'-----------
    Sheets("INGE (3)").Select
           If Cells(5, 1).End(xlDown).Row > 5 Then
        Range(Cells(6, 1), Cells(Cells(5, 1).End(xlDown).Row, 14)).ClearContents
            End If
'-----------
    Sheets("INGE (4)").Select
           If Cells(5, 1).End(xlDown).Row > 5 Then
        Range(Cells(6, 1), Cells(Cells(5, 1).End(xlDown).Row, 14)).ClearContents
            End If
'___________
'-----------
    Sheets("SUPPLY").Select
           If Cells(5, 1).End(xlDown).Row > 5 Then
        Range(Cells(6, 1), Cells(Cells(5, 1).End(xlDown).Row, 14)).ClearContents
            End If
'-----------
    Sheets("SUPPLY (2)").Select
           If Cells(5, 1).End(xlDown).Row > 5 Then
        Range(Cells(6, 1), Cells(Cells(5, 1).End(xlDown).Row, 14)).ClearContents
            End If
'-----------
    Sheets("SUPPLY (3)").Select
           If Cells(5, 1).End(xlDown).Row > 5 Then
        Range(Cells(6, 1), Cells(Cells(5, 1).End(xlDown).Row, 14)).ClearContents
            End If
'-----------
    Sheets("SUPPLY (4)").Select
           If Cells(5, 1).End(xlDown).Row > 5 Then
        Range(Cells(6, 1), Cells(Cells(5, 1).End(xlDown).Row, 14)).ClearContents
            End If
'___________
'-----------
    Sheets("LABO").Select
           If Cells(5, 1).End(xlDown).Row > 5 Then
        Range(Cells(6, 1), Cells(Cells(5, 1).End(xlDown).Row, 14)).ClearContents
            End If
'-----------
    Sheets("LABO (2)").Select
           If Cells(5, 1).End(xlDown).Row > 5 Then
        Range(Cells(6, 1), Cells(Cells(5, 1).End(xlDown).Row, 14)).ClearContents
            End If
'-----------
    Sheets("LABO (3)").Select
           If Cells(5, 1).End(xlDown).Row > 5 Then
        Range(Cells(6, 1), Cells(Cells(5, 1).End(xlDown).Row, 14)).ClearContents
            End If
'-----------
    Sheets("LABO (4)").Select
           If Cells(5, 1).End(xlDown).Row > 5 Then
        Range(Cells(6, 1), Cells(Cells(5, 1).End(xlDown).Row, 14)).ClearContents
            End If
'___________
'-----------
    Sheets("SGPCOR").Select
           If Cells(5, 1).End(xlDown).Row > 5 Then
        Range(Cells(6, 1), Cells(Cells(5, 1).End(xlDown).Row, 14)).ClearContents
            End If
'-----------
    Sheets("SGPCOR (2)").Select
           If Cells(5, 1).End(xlDown).Row > 5 Then
        Range(Cells(6, 1), Cells(Cells(5, 1).End(xlDown).Row, 14)).ClearContents
            End If
'-----------
    Sheets("SGPCOR (3)").Select
           If Cells(5, 1).End(xlDown).Row > 5 Then
        Range(Cells(6, 1), Cells(Cells(5, 1).End(xlDown).Row, 14)).ClearContents
            End If
'-----------
    Sheets("SGPCOR (4)").Select
           If Cells(5, 1).End(xlDown).Row > 5 Then
        Range(Cells(6, 1), Cells(Cells(5, 1).End(xlDown).Row, 14)).ClearContents
            End If
'___________
'-----------
    Sheets("COSMETO").Select
           If Cells(5, 1).End(xlDown).Row > 5 Then
        Range(Cells(6, 1), Cells(Cells(5, 1).End(xlDown).Row, 14)).ClearContents
            End If
'-----------
    Sheets("COSMETO (2)").Select
           If Cells(5, 1).End(xlDown).Row > 5 Then
        Range(Cells(6, 1), Cells(Cells(5, 1).End(xlDown).Row, 14)).ClearContents
            End If
'-----------
    Sheets("COSMETO (3)").Select
           If Cells(5, 1).End(xlDown).Row > 5 Then
        Range(Cells(6, 1), Cells(Cells(5, 1).End(xlDown).Row, 14)).ClearContents
            End If
'-----------
    Sheets("COSMETO (4)").Select
           If Cells(5, 1).End(xlDown).Row > 5 Then
        Range(Cells(6, 1), Cells(Cells(5, 1).End(xlDown).Row, 14)).ClearContents
            End If
'___________
'-----------
    Sheets("FABFS").Select
           If Cells(5, 1).End(xlDown).Row > 5 Then
        Range(Cells(6, 1), Cells(Cells(5, 1).End(xlDown).Row, 14)).ClearContents
            End If
'-----------
    Sheets("FABFS (2)").Select
           If Cells(5, 1).End(xlDown).Row > 5 Then
        Range(Cells(6, 1), Cells(Cells(5, 1).End(xlDown).Row, 14)).ClearContents
            End If
'-----------
    Sheets("FABFS (3)").Select
           If Cells(5, 1).End(xlDown).Row > 5 Then
        Range(Cells(6, 1), Cells(Cells(5, 1).End(xlDown).Row, 14)).ClearContents
            End If
'-----------
    Sheets("FABFS (4)").Select
           If Cells(5, 1).End(xlDown).Row > 5 Then
        Range(Cells(6, 1), Cells(Cells(5, 1).End(xlDown).Row, 14)).ClearContents
            End If
'___________
'-----------
    Sheets("CDTFS").Select
           If Cells(5, 1).End(xlDown).Row > 5 Then
        Range(Cells(6, 1), Cells(Cells(5, 1).End(xlDown).Row, 14)).ClearContents
            End If
'-----------
    Sheets("CDTFS (2)").Select
           If Cells(5, 1).End(xlDown).Row > 5 Then
        Range(Cells(6, 1), Cells(Cells(5, 1).End(xlDown).Row, 14)).ClearContents
            End If
'-----------
    Sheets("CDTFS (3)").Select
           If Cells(5, 1).End(xlDown).Row > 5 Then
        Range(Cells(6, 1), Cells(Cells(5, 1).End(xlDown).Row, 14)).ClearContents
            End If
'-----------
    Sheets("CDTFS (4)").Select
           If Cells(5, 1).End(xlDown).Row > 5 Then
        Range(Cells(6, 1), Cells(Cells(5, 1).End(xlDown).Row, 14)).ClearContents
            End If
'___________
'-----------
    Sheets("MAINT").Select
           If Cells(5, 1).End(xlDown).Row > 5 Then
        Range(Cells(6, 1), Cells(Cells(5, 1).End(xlDown).Row, 14)).ClearContents
            End If
'-----------
    Sheets("MAINT (2)").Select
           If Cells(5, 1).End(xlDown).Row > 5 Then
        Range(Cells(6, 1), Cells(Cells(5, 1).End(xlDown).Row, 14)).ClearContents
            End If
'-----------
    Sheets("MAINT (3)").Select
           If Cells(5, 1).End(xlDown).Row > 5 Then
        Range(Cells(6, 1), Cells(Cells(5, 1).End(xlDown).Row, 14)).ClearContents
            End If
'-----------
    Sheets("MAINT (4)").Select
           If Cells(5, 1).End(xlDown).Row > 5 Then
        Range(Cells(6, 1), Cells(Cells(5, 1).End(xlDown).Row, 14)).ClearContents
            End If
'___________
'-----------
    Sheets("Qualite").Select
           If Cells(5, 1).End(xlDown).Row > 5 Then
        Range(Cells(6, 1), Cells(Cells(5, 1).End(xlDown).Row, 14)).ClearContents
            End If
'-----------
    Sheets("Qualite (2)").Select
           If Cells(5, 1).End(xlDown).Row > 5 Then
        Range(Cells(6, 1), Cells(Cells(5, 1).End(xlDown).Row, 14)).ClearContents
            End If
'-----------
    Sheets("Qualite (3)").Select
           If Cells(5, 1).End(xlDown).Row > 5 Then
        Range(Cells(6, 1), Cells(Cells(5, 1).End(xlDown).Row, 14)).ClearContents
            End If
'-----------
    Sheets("Qualite (4)").Select
           If Cells(5, 1).End(xlDown).Row > 5 Then
        Range(Cells(6, 1), Cells(Cells(5, 1).End(xlDown).Row, 14)).ClearContents
            End If
'___________
'-----------
    Sheets("PROD").Select
           If Cells(5, 1).End(xlDown).Row > 5 Then
        Range(Cells(6, 1), Cells(Cells(5, 1).End(xlDown).Row, 14)).ClearContents
            End If
'-----------
    Sheets("PROD (2)").Select
           If Cells(5, 1).End(xlDown).Row > 5 Then
        Range(Cells(6, 1), Cells(Cells(5, 1).End(xlDown).Row, 14)).ClearContents
            End If
'-----------
    Sheets("PROD (3)").Select
           If Cells(5, 1).End(xlDown).Row > 5 Then
        Range(Cells(6, 1), Cells(Cells(5, 1).End(xlDown).Row, 14)).ClearContents
            End If
'-----------
    Sheets("PROD (4)").Select
           If Cells(5, 1).End(xlDown).Row > 5 Then
        Range(Cells(6, 1), Cells(Cells(5, 1).End(xlDown).Row, 14)).ClearContents
            End If













'___________________________________________________________________________________
'-----------------------------------------------------------------------------------
'Mise à jour des feuilles (secteur par secteur)
'___________________________________________________________________________________
'-----------------------------------------------------------------------------------

    '1 / MAJ
        '-- Mise à jour des MDC closes --
    
Sheets("ListeMDC").Select       '(1)
Selection.AutoFilter Field:=14, Criteria1:="<>" '(2)

If Cells(5, 1).End(xlDown).Row > 5 Then '(3)
    Range(Cells(6, 1), Cells(Cells(5, 1).End(xlDown).Row, 14)).Select '(4)
    Selection.Copy '(5)
    Sheets("MDCcloses").Select '(6)
    Range("A6").Select '(8)
    ActiveSheet.Paste '(9)
End If
                            '+++++Explications++++++ :
                            
'(1) permet la sélection de la feuille ListeMDC
    
'(2) permet de filtrer les données, <> signie "non vides"
        'pour que la ligne ci dessus fonctionne,
        'il faut au préalable activer les filtres de la colonne A à N sur la ListeMDC
        'Si ce n'est pas fait :rajouter Range("A5:N5").select et selection.autofilter
    
'(3) Pose la condition : si détecte plus de 5 lignes la copie s'effectue.
        'Autrement dit s'il n'y a pas de MDC dans la feuille la copie ne se fait pas. Cela évitera d'obenir deux lignes de titres lors d'une copie.
        'If Range("A65536").End(xlUp).Row > 5 Then (= autre façon de procéder en partant de la dernière ligne)
         
'(4) Cherche la première ligne complétée et sélectionne toutes les autres lignes non vides de la colonne 1 à 14 (A à N)

'(5) Copie la sélection

'(6) Sélectionne la feuille de destination

'(7) Supprime le contenu des cellules (en dessous de la ligne 5)

'(8) Se positionne sur la première ligne colone A

'(9) Coller la sélection
 
    'Si nécessaire enlever la sélection des MDC closes en désactivant le filtre
        'Sheets("ListeMDC").Select
        'Selection.AutoFilter Field:=14 --> désélectionne la colonne 14, càd N
        

                    '_____________________________________________'
                    

Sheets("ListeMDC").Select
Selection.AutoFilter Field:=13
Selection.AutoFilter Field:=14


    '2/ --Mise à jour suite--


        'MDC ouvertes :
            Sheets("ListeMDC").Select
            Selection.AutoFilter Field:=14, Criteria1:=""
            Selection.AutoFilter Field:=11
            If Cells(5, 1).End(xlDown).Row > 5 Then
                Range(Cells(6, 1), Cells(Cells(5, 1).End(xlDown).Row, 14)).Select
                Selection.Copy
                Sheets("MDCouvertes").Select
                Range("A6").Select
                ActiveSheet.Paste
            End If

    '-----------
        'AQS:
            Sheets("ListeMDC").Select
            Selection.AutoFilter Field:=14, Criteria1:=""
            Selection.AutoFilter Field:=11, Criteria1:="AQS"
            If Cells(5, 1).End(xlDown).Row > 5 Then
                Range(Cells(6, 1), Cells(Cells(5, 1).End(xlDown).Row, 14)).Select
                Selection.Copy
                Sheets("AQS").Select
                Range("A6").Select
                ActiveSheet.Paste
            End If
            
    '-----------
        'AQO:
            Sheets("ListeMDC").Select
            Selection.AutoFilter Field:=14, Criteria1:=""
            Selection.AutoFilter Field:=11, Criteria1:="AQO"
            If Cells(5, 1).End(xlDown).Row > 5 Then
                Range(Cells(6, 1), Cells(Cells(5, 1).End(xlDown).Row, 14)).Select
                Selection.Copy
                Sheets("AQO").Select
                Range("A6").Select
                ActiveSheet.Paste
            End If
        
    '-----------
        'EHS:
    
            Sheets("ListeMDC").Select
            Selection.AutoFilter Field:=14, Criteria1:=""
            Selection.AutoFilter Field:=11, Criteria1:="EHS"
            If Cells(5, 1).End(xlDown).Row > 5 Then
                Range(Cells(6, 1), Cells(Cells(5, 1).End(xlDown).Row, 14)).Select
                Selection.Copy
                Sheets("EHS").Select
                Range("A6").Select
                ActiveSheet.Paste
            End If
            
    '-----------
        'REGL:
            Sheets("ListeMDC").Select
            Selection.AutoFilter Field:=14, Criteria1:=""
            Selection.AutoFilter Field:=11, Criteria1:="REGL"
            If Cells(5, 1).End(xlDown).Row > 5 Then
                Range(Cells(6, 1), Cells(Cells(5, 1).End(xlDown).Row, 14)).Select
                Selection.Copy
                Sheets("REGL").Select
                Range("A6").Select
                ActiveSheet.Paste
            End If
            
    '-----------
        'INDUS:
            Sheets("ListeMDC").Select
            Selection.AutoFilter Field:=14, Criteria1:=""
            Selection.AutoFilter Field:=11, Criteria1:="INDUS"
            If Cells(5, 1).End(xlDown).Row > 5 Then
                Range(Cells(6, 1), Cells(Cells(5, 1).End(xlDown).Row, 14)).Select
                Selection.Copy
                Sheets("INDUS").Select
                Range("A6").Select
                ActiveSheet.Paste
            End If
            
    '-----------
        'INGE:
            Sheets("ListeMDC").Select
            Selection.AutoFilter Field:=14, Criteria1:=""
            Selection.AutoFilter Field:=11, Criteria1:="INGENIERIE"
            If Cells(5, 1).End(xlDown).Row > 5 Then
                Range(Cells(6, 1), Cells(Cells(5, 1).End(xlDown).Row, 14)).Select
                Selection.Copy
                Sheets("INGE").Select
                Range("A6").Select
                ActiveSheet.Paste
            End If
            
    '-----------
        'SUPPLY:
            Sheets("ListeMDC").Select
            Selection.AutoFilter Field:=14, Criteria1:=""
            Selection.AutoFilter Field:=11, Criteria1:="SUPPLY"
            If Cells(5, 1).End(xlDown).Row > 5 Then
                Range(Cells(6, 1), Cells(Cells(5, 1).End(xlDown).Row, 14)).Select
                Selection.Copy
                Sheets("SUPPLY").Select
                Range("A6").Select
                ActiveSheet.Paste
            End If
            
    '-----------
        'LABO:
            Sheets("ListeMDC").Select
            Selection.AutoFilter Field:=11, Criteria1:="LABO"
            If Cells(5, 1).End(xlDown).Row > 5 Then
                Range(Cells(6, 1), Cells(Cells(5, 1).End(xlDown).Row, 14)).Select
                Selection.Copy
                Sheets("LABO").Select
                Range("A6").Select
                ActiveSheet.Paste
            End If
            
    '-----------
        'SG-PC-OR:
            Sheets("ListeMDC").Select
            Selection.AutoFilter Field:=14, Criteria1:=""
            Selection.AutoFilter Field:=11, Criteria1:="SIROP-CREME-OROKEN"
            If Cells(5, 1).End(xlDown).Row > 5 Then
                Range(Cells(6, 1), Cells(Cells(5, 1).End(xlDown).Row, 14)).Select
                Selection.Copy
                Sheets("SGPCOR").Select
                Range("A6").Select
                ActiveSheet.Paste
            End If
            
    '-----------
        'COSMETO:
            Sheets("ListeMDC").Select
            Selection.AutoFilter Field:=14, Criteria1:=""
            Selection.AutoFilter Field:=11, Criteria1:="COSMETO"
            If Cells(5, 1).End(xlDown).Row > 5 Then
                Range(Cells(6, 1), Cells(Cells(5, 1).End(xlDown).Row, 14)).Select
                Selection.Copy
                Sheets("COSMETO").Select
                Range("A6").Select
                ActiveSheet.Paste
            End If
            
    '-----------
        'FAF FS:
            Sheets("ListeMDC").Select
            Selection.AutoFilter Field:=14, Criteria1:=""
            Selection.AutoFilter Field:=11, Criteria1:="FAB FS"
            If Cells(5, 1).End(xlDown).Row > 5 Then
                Range(Cells(6, 1), Cells(Cells(5, 1).End(xlDown).Row, 14)).Select
                Selection.Copy
                Sheets("FABFS").Select
                Range("A6").Select
                ActiveSheet.Paste
            End If
            
    '-----------
        'CDT FS:
            Sheets("ListeMDC").Select
            Selection.AutoFilter Field:=14, Criteria1:=""
            Selection.AutoFilter Field:=11, Criteria1:="CDT FS"
            If Cells(5, 1).End(xlDown).Row > 5 Then
                Range(Cells(6, 1), Cells(Cells(5, 1).End(xlDown).Row, 14)).Select
                Selection.Copy
                Sheets("CDTFS").Select
                Range("A6").Select
                ActiveSheet.Paste
            End If
            
    '-----------
        'MAINT:
            Sheets("ListeMDC").Select
            Selection.AutoFilter Field:=14, Criteria1:=""
            Selection.AutoFilter Field:=11, Criteria1:="MAINT"
            If Cells(5, 1).End(xlDown).Row > 5 Then
                Range(Cells(6, 1), Cells(Cells(5, 1).End(xlDown).Row, 14)).Select
                Selection.Copy
                Sheets("MAINT").Select
                Range("A6").Select
                ActiveSheet.Paste
            End If
            
    '-----------
        'Qualité:
            Sheets("ListeMDC").Select
            Selection.AutoFilter Field:=14, Criteria1:=""
            Selection.AutoFilter Field:=11, Criteria1:="Q"
            
            'Ici je remplace la condition : If Cells(5, 1).End(xlDown).Row > 5 Then par celle-ci :
            If Not IsEmpty(Cells(5, 1).End(xlDown)) Then
                Range(Cells(6, 1), Cells(Cells(5, 1).End(xlDown).Row, 14)).Select
                Selection.Copy
                Sheets("Qualite").Select
                Range("A6").Select
                ActiveSheet.Paste
            End If
            
    '-----------
        'PROD:
            Sheets("ListeMDC").Select
            Selection.AutoFilter Field:=14, Criteria1:=""
            Selection.AutoFilter Field:=11, Criteria1:="PROD"
            
            'Ici je remplace la condition : If Cells(5, 1).End(xlDown).Row > 5 Then par celle-ci :
            If Not IsEmpty(Cells(5, 1).End(xlDown)) Then
                Range(Cells(6, 1), Cells(Cells(5, 1).End(xlDown).Row, 14)).Select
                Selection.Copy
                Sheets("PROD").Select
                Range("A6").Select
                ActiveSheet.Paste
            End If
            'la condition change car la feuille PROD n'est quasiment jamais remplie. et cela evite que trop de lignes ne se copient.
            
'Rétablir la liste MDC sans les filtres
    
Sheets("ListeMDC").Select
    Selection.AutoFilter Field:=11
    Selection.AutoFilter Field:=14
    Selection.AutoFilter Field:=13
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
'***

'POUR TOUTES LES MACRO QUI SUIVENT JE MET LA CONDITION : If Range("A6") = "<>" Then
'Si un problème se pose à l'avenir il faudra remettre :
        'If Cells(5, 1).End(xlDown).Row > 5 Then
        'Ou alors : If Not Isempty(Range("A6:A2000") Then
        'Ou If Not IsEmpty(Cells(5, 1).End(xlDown)) Then
'***
            
            
            
            
            
            
            
'___________________________________________________________________________________
'-----------------------------------------------------------------------------------
'Mise à jour des pages cachées : actions closes des MDC en cours(secteur par secteur)
'___________________________________________________________________________________
'-----------------------------------------------------------------------------------
                                         'dans le but de compléter les statistiques.
Sheets("ListeMDC").Select
Selection.AutoFilter Field:=14, Criteria1:=""
    '-----------
        'AQS2:
                Sheets("ListeMDC").Select
                Selection.AutoFilter Field:=11, Criteria1:="AQS"
                Selection.AutoFilter Field:=13, Criteria1:="<>"
            If Not IsEmpty(Cells(5, 1).End(xlDown)) Then
                Range(Cells(6, 1), Cells(Cells(5, 1).End(xlDown).Row, 14)).Select
                Selection.Copy
                Sheets("AQS (2)").Select
                Range("A6").Select
                ActiveSheet.Paste
            End If
            
    '-----------
        'AQO2:
            Sheets("ListeMDC").Select
            Selection.AutoFilter Field:=11, Criteria1:="AQO"
            Selection.AutoFilter Field:=13, Criteria1:="<>"
            If Not IsEmpty(Cells(5, 1).End(xlDown)) Then
                Range(Cells(6, 1), Cells(Cells(5, 1).End(xlDown).Row, 14)).Select
                Selection.Copy
                Sheets("AQO (2)").Select
                Range("A6").Select
                ActiveSheet.Paste
            End If
            
    '-----------
        'EHS2:
            Sheets("ListeMDC").Select
            Selection.AutoFilter Field:=11, Criteria1:="EHS"
            Selection.AutoFilter Field:=13, Criteria1:="<>"
            If Not IsEmpty(Cells(5, 1).End(xlDown)) Then
                Range(Cells(6, 1), Cells(Cells(5, 1).End(xlDown).Row, 14)).Select
                Selection.Copy
                Sheets("EHS (2)").Select
                Range("A6").Select
                ActiveSheet.Paste
            End If
            
    '-----------
        'REGL2:
            Sheets("ListeMDC").Select
            Selection.AutoFilter Field:=11, Criteria1:="REGL"
            Selection.AutoFilter Field:=13, Criteria1:="<>"
            If Not IsEmpty(Cells(5, 1).End(xlDown)) Then
                Range(Cells(6, 1), Cells(Cells(5, 1).End(xlDown).Row, 14)).Select
                Selection.Copy
                Sheets("REGL (2)").Select
                Range("A6").Select
                ActiveSheet.Paste
            End If
            
    '-----------
        'INDUS2:
            Sheets("ListeMDC").Select
            Selection.AutoFilter Field:=11, Criteria1:="INDUS"
            Selection.AutoFilter Field:=13, Criteria1:="<>"
            If Not IsEmpty(Cells(5, 1).End(xlDown)) Then
                Range(Cells(6, 1), Cells(Cells(5, 1).End(xlDown).Row, 14)).Select
                Selection.Copy
                Sheets("INDUS (2)").Select
                Range("A6").Select
                ActiveSheet.Paste
            End If
            
    '-----------
        'INGE2:
            Sheets("ListeMDC").Select
            Selection.AutoFilter Field:=11, Criteria1:="INGENIERIE"
            Selection.AutoFilter Field:=13, Criteria1:="<>"
            If Not IsEmpty(Cells(5, 1).End(xlDown)) Then
                Range(Cells(6, 1), Cells(Cells(5, 1).End(xlDown).Row, 14)).Select
                Selection.Copy
                Sheets("INGE (2)").Select
                Range("A6").Select
                ActiveSheet.Paste
            End If
            
    '-----------
        'SUPPLY2:
            Sheets("ListeMDC").Select
            Selection.AutoFilter Field:=11, Criteria1:="SUPPLY"
            Selection.AutoFilter Field:=13, Criteria1:="<>"
            If Not IsEmpty(Cells(5, 1).End(xlDown)) Then
                Range(Cells(6, 1), Cells(Cells(5, 1).End(xlDown).Row, 14)).Select
                Selection.Copy
                Sheets("SUPPLY (2)").Select
                Range("A6").Select
                ActiveSheet.Paste
            End If
            
    '-----------
        'LABO2:
            Sheets("ListeMDC").Select
            Selection.AutoFilter Field:=11, Criteria1:="LABO"
            Selection.AutoFilter Field:=13, Criteria1:="<>"
            If Not IsEmpty(Cells(5, 1).End(xlDown)) Then
                Range(Cells(6, 1), Cells(Cells(5, 1).End(xlDown).Row, 14)).Select
                Selection.Copy
                Sheets("LABO (2)").Select
                Range("A6").Select
                ActiveSheet.Paste
            End If
            
    '-----------
        'SG-PC-OR2:
            Sheets("ListeMDC").Select
            Selection.AutoFilter Field:=11, Criteria1:="SIROP-CREME-OROKEN"
            Selection.AutoFilter Field:=13, Criteria1:="<>"
            If Not IsEmpty(Cells(5, 1).End(xlDown)) Then
                Range(Cells(6, 1), Cells(Cells(5, 1).End(xlDown).Row, 14)).Select
                Selection.Copy
                Sheets("SGPCOR (2)").Select
                Range("A6").Select
                ActiveSheet.Paste
            End If
            
    '-----------
        'COSMETO2:
            Sheets("ListeMDC").Select
            Selection.AutoFilter Field:=11, Criteria1:="COSMETO"
            Selection.AutoFilter Field:=13, Criteria1:="<>"
            If Not IsEmpty(Cells(5, 1).End(xlDown)) Then
                Range(Cells(6, 1), Cells(Cells(5, 1).End(xlDown).Row, 14)).Select
                Selection.Copy
                Sheets("COSMETO (2)").Select
                Range("A6").Select
                ActiveSheet.Paste
            End If
            
    '-----------
        'FAF FS2:
            Sheets("ListeMDC").Select
            Selection.AutoFilter Field:=11, Criteria1:="FAB FS"
            Selection.AutoFilter Field:=13, Criteria1:="<>"
            If Not IsEmpty(Cells(5, 1).End(xlDown)) Then
                Range(Cells(6, 1), Cells(Cells(5, 1).End(xlDown).Row, 14)).Select
                Selection.Copy
                Sheets("FABFS (2)").Select
                Range("A6").Select
                ActiveSheet.Paste
            End If
            
    '-----------
        'CDT FS2:
            Sheets("ListeMDC").Select
            Selection.AutoFilter Field:=11, Criteria1:="CDT FS"
            Selection.AutoFilter Field:=13, Criteria1:="<>"
            If Not IsEmpty(Cells(5, 1).End(xlDown)) Then
                Range(Cells(6, 1), Cells(Cells(5, 1).End(xlDown).Row, 14)).Select
                Selection.Copy
                Sheets("CDTFS (2)").Select
                Range("A6").Select
                ActiveSheet.Paste
            End If
            
    '-----------
        'MAINT2:
            Sheets("ListeMDC").Select
            Selection.AutoFilter Field:=11, Criteria1:="MAINT"
            Selection.AutoFilter Field:=13, Criteria1:="<>"
            If Not IsEmpty(Cells(5, 1).End(xlDown)) Then
                Range(Cells(6, 1), Cells(Cells(5, 1).End(xlDown).Row, 14)).Select
                Selection.Copy
                Sheets("MAINT (2)").Select
                Range("A6").Select
                ActiveSheet.Paste
            End If
            
    '-----------
        'Qualité2:
            Sheets("ListeMDC").Select
            Selection.AutoFilter Field:=11, Criteria1:="Q"
            Selection.AutoFilter Field:=13, Criteria1:="<>"
            If Not IsEmpty(Cells(5, 1).End(xlDown)) Then
                Range(Cells(6, 1), Cells(Cells(5, 1).End(xlDown).Row, 14)).Select
                Selection.Copy
                Sheets("Qualite (2)").Select
                Range("A6").Select
                ActiveSheet.Paste
            End If
            
    '-----------
        'PROD2:
            Sheets("ListeMDC").Select
            Selection.AutoFilter Field:=11, Criteria1:="PROD"
            Selection.AutoFilter Field:=13, Criteria1:="<>"
            If Not IsEmpty(Cells(5, 1).End(xlDown)) Then
                Range(Cells(6, 1), Cells(Cells(5, 1).End(xlDown).Row, 14)).Select
                Selection.Copy
                Sheets("PROD (2)").Select
                Range("A6").Select
                ActiveSheet.Paste
            End If

'Rétablir la liste MDC sans les filtres
    
Sheets("ListeMDC").Select
    Selection.AutoFilter Field:=11
    Selection.AutoFilter Field:=14
    Selection.AutoFilter Field:=13




















'___________________________________________________________________________________
'-----------------------------------------------------------------------------------
'Mise à jour des pages cachées : MDC initiées non closes (secteur par secteur)
'___________________________________________________________________________________
'-----------------------------------------------------------------------------------

    '-----------
        'AQS3:
                Sheets("ListeMDC").Select
                Selection.AutoFilter Field:=5, Criteria1:="AQS"
                Selection.AutoFilter Field:=14, Criteria1:=""
            If Not IsEmpty(Cells(5, 1).End(xlDown)) Then
                Range(Cells(6, 1), Cells(Cells(5, 1).End(xlDown).Row, 14)).Select
                Selection.Copy
                Sheets("AQS (3)").Select
                Range("A6").Select
                ActiveSheet.Paste
            End If
            
    '-----------
        'AQO3:
            Sheets("ListeMDC").Select
            Selection.AutoFilter Field:=5, Criteria1:="AQO"
            Selection.AutoFilter Field:=14, Criteria1:=""
            If Not IsEmpty(Cells(5, 1).End(xlDown)) Then
                Range(Cells(6, 1), Cells(Cells(5, 1).End(xlDown).Row, 14)).Select
                Selection.Copy
                Sheets("AQO (3)").Select
                Range("A6").Select
                ActiveSheet.Paste
            End If
            
    '-----------
        'EHS3:
            Sheets("ListeMDC").Select
            Selection.AutoFilter Field:=5, Criteria1:="EHS"
            Selection.AutoFilter Field:=14, Criteria1:=""
            If Not IsEmpty(Cells(5, 1).End(xlDown)) Then
                Range(Cells(6, 1), Cells(Cells(5, 1).End(xlDown).Row, 14)).Select
                Selection.Copy
                Sheets("EHS (3)").Select
                Range("A6").Select
                ActiveSheet.Paste
            End If
            
    '-----------
        'REGL3:
            Sheets("ListeMDC").Select
            Selection.AutoFilter Field:=5, Criteria1:="REGL"
            Selection.AutoFilter Field:=14, Criteria1:=""
            If Not IsEmpty(Cells(5, 1).End(xlDown)) Then
                Range(Cells(6, 1), Cells(Cells(5, 1).End(xlDown).Row, 14)).Select
                Selection.Copy
                Sheets("REGL (3)").Select
                Range("A6").Select
                ActiveSheet.Paste
            End If
            
    '-----------
        'INDUS3:
            Sheets("ListeMDC").Select
            Selection.AutoFilter Field:=5, Criteria1:="INDUS"
            Selection.AutoFilter Field:=14, Criteria1:=""
            If Not IsEmpty(Cells(5, 1).End(xlDown)) Then
                Range(Cells(6, 1), Cells(Cells(5, 1).End(xlDown).Row, 14)).Select
                Selection.Copy
                Sheets("INDUS (3)").Select
                Range("A6").Select
                ActiveSheet.Paste
            End If
            
    '-----------
        'INGE3:
            Sheets("ListeMDC").Select
            Selection.AutoFilter Field:=5, Criteria1:="INGENIERIE"
            Selection.AutoFilter Field:=14, Criteria1:=""
            If Not IsEmpty(Cells(5, 1).End(xlDown)) Then
                Range(Cells(6, 1), Cells(Cells(5, 1).End(xlDown).Row, 14)).Select
                Selection.Copy
                Sheets("INGE (3)").Select
                Range("A6").Select
                ActiveSheet.Paste
            End If
            
    '-----------
        'SUPPLY3:
            Sheets("ListeMDC").Select
            Selection.AutoFilter Field:=5, Criteria1:="SUPPLY"
            Selection.AutoFilter Field:=14, Criteria1:=""
            If Not IsEmpty(Cells(5, 1).End(xlDown)) Then
                Range(Cells(6, 1), Cells(Cells(5, 1).End(xlDown).Row, 14)).Select
                Selection.Copy
                Sheets("SUPPLY (3)").Select
                Range("A6").Select
                ActiveSheet.Paste
            End If
            
    '-----------
        'LABO3:
            Sheets("ListeMDC").Select
            Selection.AutoFilter Field:=5, Criteria1:="LABO"
            Selection.AutoFilter Field:=14, Criteria1:=""
            If Not IsEmpty(Cells(5, 1).End(xlDown)) Then
                Range(Cells(6, 1), Cells(Cells(5, 1).End(xlDown).Row, 14)).Select
                Selection.Copy
                Sheets("LABO (3)").Select
                Range("A6").Select
                ActiveSheet.Paste
            End If
            
    '-----------
        'SG-PC-OR3:
            Sheets("ListeMDC").Select
            Selection.AutoFilter Field:=5, Criteria1:="SIROP-CREME-OROKEN"
            Selection.AutoFilter Field:=14, Criteria1:=""
            If Not IsEmpty(Cells(5, 1).End(xlDown)) Then
                Range(Cells(6, 1), Cells(Cells(5, 1).End(xlDown).Row, 14)).Select
                Selection.Copy
                Sheets("SGPCOR (3)").Select
                Range("A6").Select
                ActiveSheet.Paste
            End If
            
    '-----------
        'COSMETO3:
            Sheets("ListeMDC").Select
            Selection.AutoFilter Field:=5, Criteria1:="COSMETO"
            Selection.AutoFilter Field:=14, Criteria1:=""
            If Not IsEmpty(Cells(5, 1).End(xlDown)) Then
                Range(Cells(6, 1), Cells(Cells(5, 1).End(xlDown).Row, 14)).Select
                Selection.Copy
                Sheets("COSMETO (3)").Select
                Range("A6").Select
                ActiveSheet.Paste
            End If
            
    '-----------
        'FAF FS3:
            Sheets("ListeMDC").Select
            Selection.AutoFilter Field:=5, Criteria1:="FAB FS"
            Selection.AutoFilter Field:=14, Criteria1:=""
            If Not IsEmpty(Cells(5, 1).End(xlDown)) Then
                Range(Cells(6, 1), Cells(Cells(5, 1).End(xlDown).Row, 14)).Select
                Selection.Copy
                Sheets("FABFS (3)").Select
                Range("A6").Select
                ActiveSheet.Paste
            End If
            
    '-----------
        'CDT FS3:
            Sheets("ListeMDC").Select
            Selection.AutoFilter Field:=5, Criteria1:="CDT FS"
            Selection.AutoFilter Field:=14, Criteria1:=""
            If Not IsEmpty(Cells(5, 1).End(xlDown)) Then
                Range(Cells(6, 1), Cells(Cells(5, 1).End(xlDown).Row, 14)).Select
                Selection.Copy
                Sheets("CDTFS (3)").Select
                Range("A6").Select
                ActiveSheet.Paste
            End If
            
    '-----------
        'MAINT3:
            Sheets("ListeMDC").Select
            Selection.AutoFilter Field:=5, Criteria1:="MAINT"
            Selection.AutoFilter Field:=14, Criteria1:=""
            If Not IsEmpty(Cells(5, 1).End(xlDown)) Then
                Range(Cells(6, 1), Cells(Cells(5, 1).End(xlDown).Row, 14)).Select
                Selection.Copy
                Sheets("MAINT (3)").Select
                Range("A6").Select
                ActiveSheet.Paste
            End If
            
    '-----------
        'Qualité3:
            Sheets("ListeMDC").Select
            Selection.AutoFilter Field:=5, Criteria1:="Q"
            Selection.AutoFilter Field:=14, Criteria1:=""
            If Not IsEmpty(Cells(5, 1).End(xlDown)) Then
                Range(Cells(6, 1), Cells(Cells(5, 1).End(xlDown).Row, 14)).Select
                Selection.Copy
                Sheets("Qualite (3)").Select
                Range("A6").Select
                ActiveSheet.Paste
            End If
            
    '-----------
        'PROD3:
            Sheets("ListeMDC").Select
            Selection.AutoFilter Field:=5, Criteria1:="PROD"
            Selection.AutoFilter Field:=14, Criteria1:=""
            If Not IsEmpty(Cells(5, 1).End(xlDown)) Then
                Range(Cells(6, 1), Cells(Cells(5, 1).End(xlDown).Row, 14)).Select
                Selection.Copy
                Sheets("PROD (3)").Select
                Range("A6").Select
                ActiveSheet.Paste
            End If
            
'Rétablir la liste MDC sans les filtres
    
Sheets("ListeMDC").Select
    Selection.AutoFilter Field:=11
    Selection.AutoFilter Field:=14
    Selection.AutoFilter Field:=13
    Selection.AutoFilter Field:=5



















'___________________________________________________________________________________
'-----------------------------------------------------------------------------------
'Mise à jour des pages cachées : MDC initiées closes (secteur par secteur)
'___________________________________________________________________________________
'-----------------------------------------------------------------------------------

    '-----------
        'AQS4:
                Sheets("ListeMDC").Select
                Selection.AutoFilter Field:=5, Criteria1:="AQS"
                Selection.AutoFilter Field:=14, Criteria1:="<>"
            If Not IsEmpty(Cells(5, 1).End(xlDown)) Then
                Range(Cells(6, 1), Cells(Cells(5, 1).End(xlDown).Row, 14)).Select
                Selection.Copy
                Sheets("AQS (4)").Select
                Range("A6").Select
                ActiveSheet.Paste
            End If
            
    '-----------
        'AQO4:
            Sheets("ListeMDC").Select
            Selection.AutoFilter Field:=5, Criteria1:="AQO"
            Selection.AutoFilter Field:=14, Criteria1:="<>"
            If Not IsEmpty(Cells(5, 1).End(xlDown)) Then
                Range(Cells(6, 1), Cells(Cells(5, 1).End(xlDown).Row, 14)).Select
                Selection.Copy
                Sheets("AQO (4)").Select
                Range("A6").Select
                ActiveSheet.Paste
            End If
            
    '-----------
        'EHS4:
            Sheets("ListeMDC").Select
            Selection.AutoFilter Field:=5, Criteria1:="EHS"
            Selection.AutoFilter Field:=14, Criteria1:="<>"
            If Not IsEmpty(Cells(5, 1).End(xlDown)) Then
                Range(Cells(6, 1), Cells(Cells(5, 1).End(xlDown).Row, 14)).Select
                Selection.Copy
                Sheets("EHS (4)").Select
                Range("A6").Select
                ActiveSheet.Paste
            End If
            
    '-----------
        'REGL4:
            Sheets("ListeMDC").Select
            Selection.AutoFilter Field:=5, Criteria1:="REGL"
            Selection.AutoFilter Field:=14, Criteria1:="<>"
            If Not IsEmpty(Cells(5, 1).End(xlDown)) Then
                Range(Cells(6, 1), Cells(Cells(5, 1).End(xlDown).Row, 14)).Select
                Selection.Copy
                Sheets("REGL (4)").Select
                Range("A6").Select
                ActiveSheet.Paste
            End If
            
    '-----------
        'INDUS4:
            Sheets("ListeMDC").Select
            Selection.AutoFilter Field:=5, Criteria1:="INDUS"
            Selection.AutoFilter Field:=14, Criteria1:="<>"
            If Not IsEmpty(Cells(5, 1).End(xlDown)) Then
                Range(Cells(6, 1), Cells(Cells(5, 1).End(xlDown).Row, 14)).Select
                Selection.Copy
                Sheets("INDUS (4)").Select
                Range("A6").Select
                ActiveSheet.Paste
            End If
            
    '-----------
        'INGE4:
            Sheets("ListeMDC").Select
            Selection.AutoFilter Field:=5, Criteria1:="INGENIERIE"
            Selection.AutoFilter Field:=14, Criteria1:="<>"
            If Not IsEmpty(Cells(5, 1).End(xlDown)) Then
                Range(Cells(6, 1), Cells(Cells(5, 1).End(xlDown).Row, 14)).Select
                Selection.Copy
                Sheets("INGE (4)").Select
                Range("A6").Select
                ActiveSheet.Paste
            End If
            
    '-----------
        'SUPPLY4:
            Sheets("ListeMDC").Select
            Selection.AutoFilter Field:=5, Criteria1:="SUPPLY"
            Selection.AutoFilter Field:=14, Criteria1:="<>"
            If Not IsEmpty(Cells(5, 1).End(xlDown)) Then
                Range(Cells(6, 1), Cells(Cells(5, 1).End(xlDown).Row, 14)).Select
                Selection.Copy
                Sheets("SUPPLY (4)").Select
                Range("A6").Select
                ActiveSheet.Paste
            End If
            
    '-----------
        'LABO4:
            Sheets("ListeMDC").Select
            Selection.AutoFilter Field:=5, Criteria1:="LABO"
            Selection.AutoFilter Field:=14, Criteria1:="<>"
            If Not IsEmpty(Cells(5, 1).End(xlDown)) Then
                Range(Cells(6, 1), Cells(Cells(5, 1).End(xlDown).Row, 14)).Select
                Selection.Copy
                Sheets("LABO (4)").Select
                Range("A6").Select
                ActiveSheet.Paste
            End If
            
    '-----------
        'SG-PC-OR4:
            Sheets("ListeMDC").Select
            Selection.AutoFilter Field:=5, Criteria1:="SIROP-CREME-OROKEN"
            Selection.AutoFilter Field:=14, Criteria1:="<>"
            If Not IsEmpty(Cells(5, 1).End(xlDown)) Then
                Range(Cells(6, 1), Cells(Cells(5, 1).End(xlDown).Row, 14)).Select
                Selection.Copy
                Sheets("SGPCOR (4)").Select
                Range("A6").Select
                ActiveSheet.Paste
            End If
            
    '-----------
        'COSMETO4:
            Sheets("ListeMDC").Select
            Selection.AutoFilter Field:=5, Criteria1:="COSMETO"
            Selection.AutoFilter Field:=14, Criteria1:="<>"
            If Not IsEmpty(Cells(5, 1).End(xlDown)) Then
                Range(Cells(6, 1), Cells(Cells(5, 1).End(xlDown).Row, 14)).Select
                Selection.Copy
                Sheets("COSMETO (4)").Select
                Range("A6").Select
                ActiveSheet.Paste
            End If
            
    '-----------
        'FAF FS4:
            Sheets("ListeMDC").Select
            Selection.AutoFilter Field:=5, Criteria1:="FAB FS"
            Selection.AutoFilter Field:=14, Criteria1:="<>"
            If Not IsEmpty(Cells(5, 1).End(xlDown)) Then
                Range(Cells(6, 1), Cells(Cells(5, 1).End(xlDown).Row, 14)).Select
                Selection.Copy
                Sheets("FABFS (4)").Select
                Range("A6").Select
                ActiveSheet.Paste
            End If
            
    '-----------
        'CDT FS4:
            Sheets("ListeMDC").Select
            Selection.AutoFilter Field:=5, Criteria1:="CDT FS"
            Selection.AutoFilter Field:=14, Criteria1:="<>"
            If Not IsEmpty(Cells(5, 1).End(xlDown)) Then
                Range(Cells(6, 1), Cells(Cells(5, 1).End(xlDown).Row, 14)).Select
                Selection.Copy
                Sheets("CDTFS (4)").Select
                Range("A6").Select
                ActiveSheet.Paste
            End If
            
    '-----------
        'MAINT4:
            Sheets("ListeMDC").Select
            Selection.AutoFilter Field:=5, Criteria1:="MAINT"
            Selection.AutoFilter Field:=14, Criteria1:="<>"
            If Not IsEmpty(Cells(5, 1).End(xlDown)) Then
                Range(Cells(6, 1), Cells(Cells(5, 1).End(xlDown).Row, 14)).Select
                Selection.Copy
                Sheets("MAINT (4)").Select
                Range("A6").Select
                ActiveSheet.Paste
            End If
            
    '-----------
        'Qualité4:
            Sheets("ListeMDC").Select
            Selection.AutoFilter Field:=5, Criteria1:="Q"
            Selection.AutoFilter Field:=14, Criteria1:="<>"
            If Not IsEmpty(Cells(5, 1).End(xlDown)) Then
                Range(Cells(6, 1), Cells(Cells(5, 1).End(xlDown).Row, 14)).Select
                Selection.Copy
                Sheets("Qualite (4)").Select
                Range("A6").Select
                ActiveSheet.Paste
            End If
            
    '-----------
        'PROD4:
            Sheets("ListeMDC").Select
            Selection.AutoFilter Field:=5, Criteria1:="PROD"
            Selection.AutoFilter Field:=14, Criteria1:="<>"
            If Not IsEmpty(Cells(5, 1).End(xlDown)) Then
                Range(Cells(6, 1), Cells(Cells(5, 1).End(xlDown).Row, 14)).Select
                Selection.Copy
                Sheets("PROD (4)").Select
                Range("A6").Select
                ActiveSheet.Paste
            End If














'Rétablir la liste MDC sans les filtres
    
Sheets("ListeMDC").Select
    Selection.AutoFilter Field:=11
    Selection.AutoFilter Field:=14
    Selection.AutoFilter Field:=13
    Selection.AutoFilter Field:=5
'___________________________________________________________________________________
'-----------------------------------------------------------------------------------
'Nombre total d'actions closes
'___________________________________________________________________________________
'-----------------------------------------------------------------------------------
                                                                   'Actions closes :
    
Sheets("ListeMDC").Select
Selection.AutoFilter Field:=13, Criteria1:="<>"
Selection.AutoFilter Field:=14, Criteria1:=""

If Not IsEmpty(Cells(5, 1).End(xlDown)) Then
    Range(Cells(6, 1), Cells(Cells(5, 1).End(xlDown).Row, 14)).Select
    Selection.Copy
    Sheets("ActionsCloses").Select
    Range("A6").Select
    ActiveSheet.Paste
End If


'Rétablir la liste MDC sans les filtres
    
Sheets("ListeMDC").Select
    Selection.AutoFilter Field:=11
    Selection.AutoFilter Field:=14
    Selection.AutoFilter Field:=13
    
    
    
    
    
'___________________________________________________________________________________
'-----------------------------------------------------------------------------------
'Retour page d'accueil pour message de confirmation de la mise à jour et sauvegarde)
'___________________________________________________________________________________
'-----------------------------------------------------------------------------------
    
    Sheets("Accueil").Select
    'ActiveWorkbook.Save         '=permet de sauvegarder après la mise à jour
    MSGBOX "La mise à jour a été effectuée" & vbLf & "Bonne journée"
    
    
    
End Sub
 
- Navigue sans publicité
- Accède à Cléa, notre assistante IA experte Excel... et pas que...
- Profite de fonctionnalités exclusives
Ton soutien permet à Excel Downloads de rester 100% gratuit et de continuer à rassembler les passionnés d'Excel.
Je deviens Supporter XLD

Discussions similaires

Réponses
8
Affichages
1 K
R
Réponses
17
Affichages
4 K
Ragnarr
R
Z
Réponses
2
Affichages
913
Z
M
Réponses
2
Affichages
2 K
Mike047
M
L
Réponses
40
Affichages
5 K
lalimace
L
Réponses
42
Affichages
3 K
M
Réponses
12
Affichages
1 K
M
Les cookies sont requis pour utiliser ce site. Vous devez les accepter pour continuer à utiliser le site. En savoir plus…