|
本帖最后由 无聊的疯子 于 2011-7-10 16:29 编辑
回复 oob111 的帖子
用下面的代码,看看是不是你想要的结果?没有清除空白单元格
- Sub c()
- hx = Sheet1.Range("a65536").End(xlUp).Row
- For x = 1 To hx
- If Cells(x, 1) <> "" And Application.Count(Range(Cells(x, 1), Cells(hx, 1))) = 5 Then Exit For
- Next
- Set Ran = Sheet1.Range(Cells(x, 1), Cells(hx, 1))
- hx = Sheet1.Range("C65536").End(xlUp).Row
- For h = hx To 1 Step -1
- If VBA.IsNumeric(Application.Match(Cells(h, 3), Ran, 0)) And Cells(h, 3) <> "" Then Cells(h, 3).Delete Shift:=xlUp
- Next
- End Sub
复制代码
|
|