'
' Filtre_1 Macro
' Affiche les articles en rupture ou menace de rupture de stock
'
' Touche de raccourci du clavier: Ctrl+s
'
Sub Filtre_1()
Range("AI5:A754").AdvancedFilter Action:=xlFilterInPlace, _
CriteriaRange:=Range("AI1:AI3"), Unique:=False
End Sub
'
' Filtre_2 Macro
' Affiche les articles dont la couverture confirmée est inférieure au seuil de payement
'
' Touche de raccourci du clavier: Ctrl+c
'
Sub Filtre_2()
Sheets("JOURNAL ").Select
Range("AJ5:AJ754").AdvancedFilter Action:=xlFilterInPlace, _
CriteriaRange:=Range("AJ1:AJ2"), Unique:=False
Range("AK3").Select
Cells.Find(What:=999, After:=ActiveCell, LookIn:=xlFormulas, _
LookAt:=xlPart, SearchOrder:=xlByColumns, SearchDirection:= _
xlNext, MatchCase:=False).Activate
Range("AC180").Select
End Sub
'
' A_payer Macro
' Affiche les articles dont la couverture confirmée est inférieure au seuil de payement
'
' Touche de raccourci du clavier: Ctrl+a
'
Sub A_payer()
Sheets("A payer").Select
Cells.Select
Selection.Delete Shift:=xlUp
Range("A1").Select
Sheets("JOURNAL ").Select
Range("AJ5:AJ754").AdvancedFilter Action:=xlFilterInPlace, _
CriteriaRange:=Range("AJ1:AJ2"), Unique:=False
Range("A3:AJ754").Select
Selection.Copy
Sheets("A payer").Select
ActiveSheet.Paste
Selection.Columns.AutoFit
Sheets("JOURNAL ").Select
Application.Run Macro:="Affiche_tout"
Range("G6").Select
Sheets("A payer").Select
Range("E3").Select
Selection.Interior.ColorIndex = xlNone
Selection.ClearContents
Columns("K:O").Select
Selection.Delete Shift:=xlToLeft
Columns("M:N").Select
Selection.Delete Shift:=xlToLeft
Columns("T:T").Select
Selection.Delete Shift:=xlToLeft
Columns("X:Z").Select
Selection.Delete Shift:=xlToLeft
Range("X3").Select
Selection.ClearContents
Range("X2").Select
ActiveCell.FormulaR1C1 = "URG-"
Range("X3").Select
ActiveCell.FormulaR1C1 = "ENCE"
Range("X3").Select
Selection.Interior.ColorIndex = xlNone
Selection.Font.ColorIndex = 1
Columns("X:X").Select
Columns("X:X").EntireColumn.AutoFit
Range("Q3").Select
With Selection.Font
.Name = "Arial"
.Size = 8
.Strikethrough = False
.Superscript = False
.Subscript = False
.OutlineFont = False
.Shadow = False
.Underline = xlNone
.ColorIndex = xlAutomatic
End With
' ActiveWindow.SmallScroll ToRight:=-7
Range("I1").Select
With Selection
.HorizontalAlignment = xlGeneral
.VerticalAlignment = xlBottom
.WrapText = False
.Orientation = xlHorizontal
End With
Range("K1").Select
ActiveCell.FormulaR1C1 = "CDR EXTER."
Range("K1").Select
With Selection
.HorizontalAlignment = xlGeneral
.VerticalAlignment = xlBottom
.WrapText = False
.Orientation = xlHorizontal
End With
Range("K1:M1").Select
' With Selection
' .HorizontalAlignment = xlCenterAcrossSelection
' .VerticalAlignment = xlBottom
' .WrapText = False
' .Orientation = xlHorizontal
' End With
With Selection
.HorizontalAlignment = xlGeneral
.VerticalAlignment = xlBottom
.WrapText = False
.Orientation = xlHorizontal
End With
Range("M1").Select
ActiveCell.FormulaR1C1 = "ENC. CONF."
Range("N1").Select
With Selection
.HorizontalAlignment = xlGeneral
.VerticalAlignment = xlBottom
.WrapText = False
.Orientation = xlHorizontal
End With
Range("M1").Select
With Selection
.HorizontalAlignment = xlGeneral
.VerticalAlignment = xlBottom
.WrapText = False
.Orientation = xlHorizontal
End With
Range("K1:L1").Select
With Selection
.HorizontalAlignment = xlCenterAcrossSelection
.VerticalAlignment = xlBottom
.WrapText = False
.Orientation = xlHorizontal
End With
Range("M1:N1").Select
With Selection
.HorizontalAlignment = xlCenterAcrossSelection
.VerticalAlignment = xlBottom
.WrapText = False
.Orientation = xlHorizontal
End With
Range("X1").Select
' Cells.Find(What:=999, After:=ActiveCell, LookIn:=xlFormulas, _
' LookAt:=xlPart, SearchOrder:=xlByColumns, SearchDirection:= _
' xlNext, MatchCase:=False).Activate
' Selection.ClearContents
End Sub
'
' Affiche_tout Macro
' Enleve tous les filtres et affiche tous les articles
'
' Touche de raccourci du clavier: Ctrl+t
'
Sub Affiche_tout()
Range("AJ5:AK754").AdvancedFilter Action:=xlFilterInPlace, _
CriteriaRange:=Range("AJ1:AK4"), Unique:=False
'
' Selection.AutoFilter
Range("AL5:AL754").Select
Selection.AutoFilter
Selection.AutoFilter Field:=1, Criteria1:="<>CMG", Operator:=xlAnd
Range("G6").Select
' ActiveSheet.ShowAllData
End Sub