السلام عليكم و رحمة الله وبركاته
اضغط زر فرز
Sub ماكرو1()
'
If Range("M1") = "1" Then
Range("B6:F280").SORT Key1:=Range("C6"), Order1:=xlAscending, Key2:=Range("D6") _
, Order2:=xlAscending, Key3:=Range("E6"), Order3:=xlAscending, Header:= _
xlGuess, OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _
DataOption1:=xlSortNormal, DataOption2:=xlSortNormal, DataOption3:= _
xlSortNormal
Range("M1") = "2"
Else
Range("B6:F280").SORT Key1:=Range("B6"), Order1:=xlAscending, Header:=xlGuess, _
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _
DataOption1:=xlSortNormal
Range("M1") = "1"
End If
End Sub
tist.rar