Bonjour à tous!
Je débute (c'est vraiment le cas de le dire) en VBA. Je suis à la recherche d'une solution me permettant de trier une plage de données sur 63 colonnes.
Ma plage est un tableau type échéancier de congés. Et je voudrais trier les colonnes en fonction du fait qu'elles soient vides ou non... (J’ai joint un exemple).
En faisant quelques recherches j'avais trouvé un code du type :
Pour trier sur une plage réduite...
J'ai donc bêtement pensé que je pouvais faire un truc du genre :
Donc forcément erreur de syntaxe/erreur de compilation...
Suis-je dans la bonne voie? Y'a-t-il plus simple?
Merci d'avance pour vos retours.
Je débute (c'est vraiment le cas de le dire) en VBA. Je suis à la recherche d'une solution me permettant de trier une plage de données sur 63 colonnes.
Ma plage est un tableau type échéancier de congés. Et je voudrais trier les colonnes en fonction du fait qu'elles soient vides ou non... (J’ai joint un exemple).
En faisant quelques recherches j'avais trouvé un code du type :
Code:
Range("a2:g9").Sort Range("b1"), xlAscending, Range("c1"), , xlAscending, Range("d1"), , xlAscending
J'ai donc bêtement pensé que je pouvais faire un truc du genre :
Code:
Range("e7:bo57").Sort Range("e6"), xlAscending, Range("f6"), , xlAscending, Range("g6"), , xlAscending, Range("h6"), , xlAscending, Range("i6"), , xlAscending, Range("j6"), , xlAscending, Range("k6"), , xlAscending, Range("l6"), , xlAscending, Range("m6"), , xlAscending, Range("n6"), , xlAscending, Range("o6"), , xlAscending, Range("p6"), , xlAscending, Range("q6"), , xlAscending, Range("r6"), , xlAscending, Range("s6"), , xlAscending, Range("t6"), , xlAscending, Range("u6"), , xlAscending, Range("v6"), , xlAscending, Range("w6"), , xlAscending, Range("x6"), , xlAscending, Range("y6"), , xlAscending, Range("z6"), , xlAscending, Range("aa6"), , xlAscending, Range("ab6"), , xlAscending, Range("ac6"), , xlAscending, Range("ad6"), , xlAscending, Range("ae6"), , xlAscending, Range("af6"), , xlAscending, Range("ag6"), , xlAscending, Range("ah6"), , xlAscending, Range("ai6"), , xlAscending, Range("aj6"), , xlAscending, Range("ak6"), , xlAscending, Range("al6"), , xlAscending, Range("am6"), , xlAscending, Range ("an6"), , xlAscending, Range("ao6"), , xlAscending, Range("ap6"), , xlAscending, Range("aq6"), , xlAscending, Range("ar6"), , xlAscending, Range("as6"), , xlAscending, Range("at6"), , xlAscending, Range("au6"), , xlAscending, Range("av6"), , xlAscending, Range("aw6"), , xlAscending, Range("ax6"), , xlAscending, Range("ay6"), , xlAscending, Range("az6"), , xlAscending, Range("ba6"), , xlAscending, Range("bb6"), , xlAscending, Range("bc6"), , xlAscending, Range("bd6"), , xlAscending, Range("be6"), , xlAscending, Range("bf6"), , xlAscending, Range("bg6"), , xlAscending, Range("bh6"), , xlAscending, Range("bi6"), , xlAscending, Range("bj6"), , xlAscending, Range("bk6"), , xlAscending, Range("bl6"), , xlAscending, Range("bm6"), , xlAscending, Range("bn6"), , xlAscending, Range("bo6"), , xlAscending
Donc forcément erreur de syntaxe/erreur de compilation...
Suis-je dans la bonne voie? Y'a-t-il plus simple?
Merci d'avance pour vos retours.