Page 161 - Bửu Ngôn Du Lịch Ba Miền Tập 1
P. 161
Loại thiết bị Giò Số lần lỗi
AI 3 15
AI 2 10
A2 3 8
A2 4 7
BI 5 6
BI 2 2
B2 3 7
B2 6 2
Nếu bạn dùng chức năng 'Record New Macro' để ghi
nhận lại các thao tác trên thì macro được tạo ra tương ứng
sẽ như sau:
Sub SortErrorMaxO
'chọn vùng dữ liệu cần sắp xếp
RangeC A2: c 1001'). Select
'thực hiện sắp xếp theo tiêu chuẩn mong muốh
Selection.Sort Key 1 :=Range('A2'),
Orderl:=xlAscending, Key2:=Range('C2'),
Order2:=xlDescending, Header:=xlGuess,
OrderCustom :=l, MatchCase:= False,
O rientation:=xlTopToBottom,
DataOption 1 :=xlSortNormal, DataOption2
:=xlSortNormal
End Sub
163