olivemotard
XLDnaute Junior
Bonjour.
Besoin d aide s il vous plait
j ai cree une macro qui trie des criteres
je pars de la bdd je la copie ailleure pour ne pas la fausser
ensuite je filtre une donnee via superieur ou egal sinon pas affiche
apres je colle encore et ainsi de suite pour trois criteres
probleme : lorsque je colle , les lignes non affichées sont prises en compte pour le tri suivant et reapparaissent
voici ma macro
Application.Visible = False
Sheets("Depart recherche").Select
Range("A2:X491").Select
Selection.Copy
Sheets("recherche2").Select
Range("A2").Select
ActiveSheet.Paste
Sheets("acceuil").Select
Range("G10").Select
Selection.Copy
Sheets("recherche2").Select
Range("AK1").Select
ActiveSheet.Paste
Set plage = [K3:K500]
For Each c In plage
If c.Value < [AK1] Then
c.EntireRow.Hidden = True
Else
c.EntireRow.Hidden = False
End If
Next c
Range("A2:X500").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("recherche1").Select
Range("A2").Select
ActiveSheet.Paste
Sheets("acceuil").Select
Range("G11").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("recherche1").Select
Range("AK1").Select
ActiveSheet.Paste
Set plage = [L3:L500]
For Each c In plage
If c.Value < [AK1] Then
c.EntireRow.Hidden = True
Else
c.EntireRow.Hidden = False
End If
Next c
Range("A2:Y524").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("recherche0").Select
Range("A2").Select
ActiveSheet.Paste
Sheets("acceuil").Select
Range("G12").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("recherche0").Select
Range("AK1").Select
ActiveSheet.Paste
Set plage = [M3:M500]
For Each c In plage
If c.Value < [AK1] Then
c.EntireRow.Hidden = True
Else
c.EntireRow.Hidden = False
End If
Next c
Range("K7").Select
Range("A3:X188").Sort Key1:=Range("K7"), Order1:=xlAscending, Header:= _
xlGuess, OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _
DataOption1:=xlSortNormal
Range("A2:X532").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("recherche").Select
ActiveWindow.SmallScroll Down:=-21
Range("A2").Select
ActiveSheet.Paste
Sheets("acceuil").Select
Range("I12").Select
Application.Visible = True
End Sub
Merci d'avance, ou si une meilleure idee que mon bricolage, je suis ouvert a toute proposition
Besoin d aide s il vous plait
j ai cree une macro qui trie des criteres
je pars de la bdd je la copie ailleure pour ne pas la fausser
ensuite je filtre une donnee via superieur ou egal sinon pas affiche
apres je colle encore et ainsi de suite pour trois criteres
probleme : lorsque je colle , les lignes non affichées sont prises en compte pour le tri suivant et reapparaissent
voici ma macro
Application.Visible = False
Sheets("Depart recherche").Select
Range("A2:X491").Select
Selection.Copy
Sheets("recherche2").Select
Range("A2").Select
ActiveSheet.Paste
Sheets("acceuil").Select
Range("G10").Select
Selection.Copy
Sheets("recherche2").Select
Range("AK1").Select
ActiveSheet.Paste
Set plage = [K3:K500]
For Each c In plage
If c.Value < [AK1] Then
c.EntireRow.Hidden = True
Else
c.EntireRow.Hidden = False
End If
Next c
Range("A2:X500").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("recherche1").Select
Range("A2").Select
ActiveSheet.Paste
Sheets("acceuil").Select
Range("G11").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("recherche1").Select
Range("AK1").Select
ActiveSheet.Paste
Set plage = [L3:L500]
For Each c In plage
If c.Value < [AK1] Then
c.EntireRow.Hidden = True
Else
c.EntireRow.Hidden = False
End If
Next c
Range("A2:Y524").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("recherche0").Select
Range("A2").Select
ActiveSheet.Paste
Sheets("acceuil").Select
Range("G12").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("recherche0").Select
Range("AK1").Select
ActiveSheet.Paste
Set plage = [M3:M500]
For Each c In plage
If c.Value < [AK1] Then
c.EntireRow.Hidden = True
Else
c.EntireRow.Hidden = False
End If
Next c
Range("K7").Select
Range("A3:X188").Sort Key1:=Range("K7"), Order1:=xlAscending, Header:= _
xlGuess, OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _
DataOption1:=xlSortNormal
Range("A2:X532").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("recherche").Select
ActiveWindow.SmallScroll Down:=-21
Range("A2").Select
ActiveSheet.Paste
Sheets("acceuil").Select
Range("I12").Select
Application.Visible = True
End Sub
Merci d'avance, ou si une meilleure idee que mon bricolage, je suis ouvert a toute proposition