Transposition lignes et colonnes selon ordre

Bonjour;

Je pense avoir mal expliquer mon souci dans un poste précédant.

et je reformule là.

Est il possible de mettre en ordre les lignes "clients" et colonnes " sous produits" par macro sur plusieurs feuilles.

Crdt

31test-origine.xlsx (18.57 Ko)

Bonjour,

proposition à tester

Sub tri()
    For Each ws In Worksheets
    With ws
        dl = .Cells(Rows.Count, 1).End(xlUp).Row
        dc = .Cells(3, Columns.Count).End(xlToLeft).Column - 1
        .Range(.Cells(5, 1), .Cells(dl, dc)).Sort key1:=.Cells(5, 1), Order1:=xlAscending, Header:=xlNo, Orientation:=xlSortColumns
        .Range(.Cells(4, 2), .Cells(dl, dc)).Sort key1:=.Cells(4, 2), Order1:=xlAscending, Header:=xlNo, Orientation:=xlSortRows
        End With
    Next
End Sub

re le forum;

Travail impeccable h2so4 merci; sauf que la colonne K ainsi que les lignes 2 et 3 ne sont pas prise en considération dans le rangement.

possible de régler le souci?

une proposition de correction

Sub tri()
    For Each ws In Worksheets
    With ws
        dl = .Cells(Rows.Count, 1).End(xlUp).Row
        dc = .Cells(3, Columns.Count).End(xlToLeft).Column
        .Range(.Cells(5, 1), .Cells(dl, dc)).Sort key1:=.Cells(5, 1), Order1:=xlAscending, Header:=xlNo, Orientation:=xlSortColumns
        .Range(.Cells(2, 2), .Cells(dl, dc - 1)).Sort key1:=.Cells(4, 2), Order1:=xlAscending, Header:=xlNo, Orientation:=xlSortRows
        End With
    Next
End Sub

re

c'est très parfait h2so4

Merci infiniment.

Rechercher des sujets similaires à "transposition lignes colonnes ordre"