- 帖子
- 976
- 主題
- 7
- 精華
- 0
- 積分
- 1018
- 點名
- 0
- 作業系統
- Win10
- 軟體版本
- Office 2016
- 閱讀權限
- 50
- 性別
- 男
- 註冊時間
- 2013-4-19
- 最後登錄
- 2026-5-26
|
回復 4# jsc0518
請測試看看,謝謝
Sub test()
Dim xR As Range, xU As Range
For Each xR In ActiveSheet.Range("B:B").SpecialCells(xlCellTypeConstants).Rows
If Not IsError(Application.Match(0, xR, 0)) Then
If xU Is Nothing Then Set xU = xR Else Set xU = Union(xR, xU)
End If
Next
If Not xU Is Nothing Then xU.EntireRow.Delete
End Sub |
|