J'aimerais bien savoir comment trier dynamiquement les colonnes (A, B,
C) et les colonnes (D, E) chaque groupe =E0 part, d=E9s la saisie.
Voila un exemple de JB, mais je n'ai pas pu l'adapter =E0 mon besoin :
Private Sub Worksheet_Change(ByVal Target As Range)
If Not Intersect([A2:E50], Target) Is Nothing And Target.Count =3D 1
Then
Range(Cells(2, Target.Column), Cells(50, Target.Column)).Sort
key1:=3DCells(2, Target.Column)
End If
End Sub
Private Sub Worksheet_Change(ByVal Target As Range) '-- groupe1: tri colonne A If Target.Column = 1 And Target.Count = 1 Then m = Target [A2:C1000].Sort Key1:=[A2] [A:A].Find(What:=m, LookIn:=xlValues).Select End If '--- groupe2: tri colonne D If Target.Column = 4 And Target.Count = 1 Then m = Target [D2:E1000].Sort Key1:=[D2] [D:D].Find(What:=m, LookIn:=xlValues).Select End If End Sub
JB
Bonsoir,
J'aimerais bien savoir comment trier dynamiquement les colonnes (A, B, C) et les colonnes (D, E) chaque groupe à part, dés la saisie.
Voila un exemple de JB, mais je n'ai pas pu l'adapter à mon besoin :
Private Sub Worksheet_Change(ByVal Target As Range) If Not Intersect([A2:E50], Target) Is Nothing And Target.Count = 1 Then Range(Cells(2, Target.Column), Cells(50, Target.Column)).Sort key1:Îlls(2, Target.Column) End If End Sub
Merci d'avance.
Bonsoir,
Je ne suis pas sûr d'avoir compris la question:
http://cjoint.com/?jvvDII3aFS
Private Sub Worksheet_Change(ByVal Target As Range)
'-- groupe1: tri colonne A
If Target.Column = 1 And Target.Count = 1 Then
m = Target
[A2:C1000].Sort Key1:=[A2]
[A:A].Find(What:=m, LookIn:=xlValues).Select
End If
'--- groupe2: tri colonne D
If Target.Column = 4 And Target.Count = 1 Then
m = Target
[D2:E1000].Sort Key1:=[D2]
[D:D].Find(What:=m, LookIn:=xlValues).Select
End If
End Sub
JB
Bonsoir,
J'aimerais bien savoir comment trier dynamiquement les colonnes (A, B,
C) et les colonnes (D, E) chaque groupe à part, dés la saisie.
Voila un exemple de JB, mais je n'ai pas pu l'adapter à mon besoin :
Private Sub Worksheet_Change(ByVal Target As Range)
If Not Intersect([A2:E50], Target) Is Nothing And Target.Count = 1
Then
Range(Cells(2, Target.Column), Cells(50, Target.Column)).Sort
key1:=Cells(2, Target.Column)
End If
End Sub
Private Sub Worksheet_Change(ByVal Target As Range) '-- groupe1: tri colonne A If Target.Column = 1 And Target.Count = 1 Then m = Target [A2:C1000].Sort Key1:=[A2] [A:A].Find(What:=m, LookIn:=xlValues).Select End If '--- groupe2: tri colonne D If Target.Column = 4 And Target.Count = 1 Then m = Target [D2:E1000].Sort Key1:=[D2] [D:D].Find(What:=m, LookIn:=xlValues).Select End If End Sub
JB
Bonsoir,
J'aimerais bien savoir comment trier dynamiquement les colonnes (A, B, C) et les colonnes (D, E) chaque groupe à part, dés la saisie.
Voila un exemple de JB, mais je n'ai pas pu l'adapter à mon besoin :
Private Sub Worksheet_Change(ByVal Target As Range) If Not Intersect([A2:E50], Target) Is Nothing And Target.Count = 1 Then Range(Cells(2, Target.Column), Cells(50, Target.Column)).Sort key1:Îlls(2, Target.Column) End If End Sub