- ©«¤l
- 75
- ¥DÃD
- 8
- ºëµØ
- 0
- ¿n¤À
- 109
- ÂI¦W
- 0
- §@·~¨t²Î
- windows XP
- ³nÅ骩¥»
- office 2010
- ¾\ŪÅv
- 20
- ©Ê§O
- ¨k
- ¨Ó¦Û
- °ª¶¯
- µù¥U®É¶¡
- 2015-4-19
- ³Ì«áµn¿ý
- 2024-8-10
|
¦^´_ 1# peter631114
Sub §ó·s_20190519()
ROW1 = Cells(Rows.Count, "C").End(3).Row
Range("C2").Select
'±Æ§Ç===============================================================
ActiveWorkbook.Worksheets("¸ê®Æ").Sort.SortFields.Clear
ActiveWorkbook.Worksheets("¸ê®Æ").Sort.SortFields.Add Key:=Range("C2:C" & ROW1), _
SortOn:=xlSortOnValues, Order:=xlAscending, DataOption:=xlSortNormal
ActiveWorkbook.Worksheets("¸ê®Æ").Sort.SortFields.Add Key:=Range("L2:L" & ROW1), _
SortOn:=xlSortOnValues, Order:=xlAscending, DataOption:=xlSortNormal
With ActiveWorkbook.Worksheets("¸ê®Æ").Sort
.SetRange Range("A1:M" & ROW1)
.Header = xlYes
.MatchCase = False
.Orientation = xlTopToBottom
.SortMethod = xlPinYin
.Apply
End With
Sheets(1).Copy after:=Sheets(Sheets.Count)
Range("A2:M" & ROW1).ClearContents
k = ActiveCell.Row
Sheets(1).Select
For i = 2 To ROW1
If Cells(i, "C") = Cells(i + 1, "C") And Cells(i, "L") = Cells(i + 1, "L") Then
Range(Cells(i, "A"), Cells(i + 1, "M")).Copy Sheets(Sheets.Count).Cells(k, "A")
k = k + 2
End If
Next
End Sub
Data.zip (32.59 KB)
|
|