Aide pour déchiffrer du langage sous VB

bonjour

J'aurais besoin de vos lumières pour m'aider à décripter tous ce language, je ne comprends pas toutes les subtilitées de VB pour excel.

J'ai besoin de comprendre ces deux macros pour les reproduire sur un nouveau fichier.

Par avance, merci.

Sub TRIER_SALLE()

    Rows("4:9").Select
    Selection.Sort Key1:=Range("A4"), Order1:=xlAscending, Header:=xlGuess, _
        OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom
    Rows("11:63").Select
    Selection.Sort Key1:=Range("A11"), Order1:=xlAscending, Header:=xlGuess, _
        OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom
    ActiveWindow.LargeScroll Down:=-2
    Range("A4:AF4").Select
    Selection.Interior.ColorIndex = 35
    Range("A5:AF5").Select
    With Selection.Interior
        .ColorIndex = 2
        .Pattern = xlSolid
    End With
    Range("A4:AF5").Select
    Selection.Copy
    Range("A6:A9").Select
    ActiveSheet.Paste
    Application.CutCopyMode = False
    Range("A11:AF11").Select
    With Selection.Interior
        .ColorIndex = 35
        .Pattern = xlSolid
    End With
    Range("A12:AF12").Select
    Selection.Interior.ColorIndex = 2
    Range("A11:AF12").Select
    Selection.Copy
    ActiveWindow.LargeScroll ToRight:=-2
    Range("A13:A63").Select
    Selection.PasteSpecial Paste:=xlFormats, Operation:=xlNone, SkipBlanks:= _
        False, Transpose:=False
    Range("A13:AF63").Select
    Range("A63").Activate
    ActiveWindow.LargeScroll ToRight:=-1
    Application.CommandBars("Stop Recording").Visible = False
End Sub

et celle là

Sub TRIER_LUNDI()
    Sheets("lundi").Select
    ActiveSheet.Unprotect
    Selection.AutoFilter Field:=1
    Rows("7:59").Select
    Selection.Sort Key1:=Range("B7"), Order1:=xlAscending, Key2:=Range("C7") _
        , Order2:=xlAscending, Key3:=Range("D7"), Order3:=xlAscending, Header:= _
        xlGuess, OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom
    ActiveWindow.LargeScroll Down:=1
    Rows("66:95").Select
    Selection.Sort Key1:=Range("B66"), Order1:=xlAscending, Key2:=Range("C66" _
        ), Order2:=xlAscending, Key3:=Range("D66"), Order3:=xlAscending, Header _
        :=xlGuess, OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom
    ActiveWindow.LargeScroll Down:=-2
    Selection.AutoFilter Field:=1, Criteria1:="<>"
    Range("a6").Select
    ActiveSheet.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True
End Sub

Merci d'avance.

Bonjour,

Une petite exploration du fichier proposé par Claude DUBOIS, illustre Maître Excel de ce forum, sur le fil suivant (fichier à télécharger)

https://www.excel-pratique.com/forum/viewtopic.php?t=3521&highlight=liste+vba+fonctions

Cela peut déjà constituer une base de recherche...

Cordialement

identifiant
6guerdon-cp004.xlsm (80.51 Ko)

Bonjour,

Revoici ton premier code simplifié avec explications de ce qui se passe.

Sub TRIER_SALLE()
'Tri des lignes 4 à 9
Rows("4:9").Sort Key1:=Range("A4"), Order1:=xlAscending, Header:=xlGuess, _
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom
'Tri des lignes 11 à 63
Rows("11:63").Sort Key1:=Range("A11"), Order1:=xlAscending, Header:=xlGuess, _
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom
'Couleur N° 35 de la plage
Range("A4:AF4").Interior.ColorIndex = 35
'Couleur N° 2 de la plage
With Range("A5:AF5").Interior.ColorIndex = 2
'Copie des cellules A4 à AF5 vers les cellules A6
Range("A4:AF5").Copy Destination:=Range("A6")
' sortir hors du ùmode copier coller
Application.CutCopyMode = False
'Couleur N° 35 de la plage
Range("A11:AF11").Selection.Interior.ColorIndex = 35
'Couleur N° 2 de la plage
Range("A12:AF12").Interior.ColorIndex = 2
'Copie des valeurs de la plage A11 à AF12 vers la plage A13
Range("A11:AF12").Copy
Range("A13").PasteSpecial Paste:=xlFormats, Operation:=xlNone, SkipBlanks:= _
False, Transpose:=False
'On cache la barre d'enregistrement macro
Application.CommandBars("Stop Recording").Visible = False
End Sub

Recopie dans le module. Les explications apparaitront en couleur verte.

Amicalement

Dan

Hello

Merci pour le tuyau je vais potasser tout cela, ca m'a l'air très intéressant.

si d'autres soucis je reviens vers vous

re,

Merci de mettre ton fil RESOLU si cela est terminé pour toi dans ce fil.

Explications --> https://forum.excel-pratique.com/viewtopic.php?t=13

Merci de ta participation

Dan

Merci pour la remise en forme de mon post ( un peu dans l'urgence j'avoue )

Je note résolu car je pense que j'ai pas mal d'info, mais je suis pas loin

Rechercher des sujets similaires à "aide dechiffrer langage"