|
Sub 隔行删0() '逐一选中一起删
r% = UsedRange.Rows.Count
c% = UsedRange.Columns.Count
r = Int(r / 2) * 2
For i% = r To 1 Step -2
s = s$ & "," & Cells(i, 1).Address(0, 0)
If Len(s) > 200 Then
Range(Mid(s, 2)).EntireRow.Delete
s = ""
End If
Next
If Len(s) Then Range(Mid(s, 2)).EntireRow.Delete
End Sub
Sub 隔行删1() '改自录制宏
r% = UsedRange.Rows.Count
c% = UsedRange.Columns.Count
Cells(1, c + 2) = 1
Cells(1, c + 2).Resize(2).AutoFill Destination:=Cells(1, c + 2).Resize(r)
Cells(1, c + 2).Resize(r).SpecialCells(xlCellTypeBlanks).EntireRow.Delete
Cells(1, c + 2).Resize(r).Clear
End Sub
Sub 隔行删2() '数组
Dim ar()
ar = UsedRange.Value
For r% = 3 To UBound(ar) Step 2
For c% = 1 To UBound(ar, 2)
ar((r + 1) / 2, c) = ar(r, c)
Next
Next
UsedRange.Clear
[a1].Resize((r - 1) / 2, c - 1) = ar
End Sub
|
评分
-
查看全部评分
|