返回列表 上一主題 發帖

如何移除關鍵字的整列

回復 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

TOP

回復  samwang
Dear samwang,
Test OK,感謝您的熱心解惑。
與您請教:若需更改關鍵字是否更改下列語法 ...
jsc0518 發表於 2022-4-20 21:42


可以查一下Excel Math用法就知道了,謝謝

TOP

        靜思自在 : 人要知福、惜福、再造福。
返回列表 上一主題