|
[广告] Excel易用宝 - 提升Excel的操作效率 · Excel / WPS表格插件 ★ 免费下载 ★ ★ 使用帮助★
- Sub round1()
- Dim r, lastr, x, y, m, i As Integer
- lastr = Sheets(1).Range("A65536").End(xlUp).Row + 1
- m = 2 '用来记录排序序号
- For i = 1 To lastr + 2
- x = i Mod 4
- y = i Mod 41
- If x = 0 Then x = 4
- For r = 2 To lastr + 2
- If Sheets(1).Cells(r, "C") = x And Sheets(1).Cells(r, "D") = y Then
- If m <> r Then
- Sheets(1).Range("A" & r & ":F" & r).Cut
- Sheets(1).Range("A" & m).Select
- Selection.Insert Shift:=xlDown
- End If
- m = m + 1
- End If
- Next
- Next
- End Sub
复制代码 |
|