Sub Step3()
'A攔下移除"單別:"
Dim yy
yy = "單別:"
For I = [a65536].End(xlUp).Row To 1 Step -1
If WorksheetFunction.CountIf(Rows(I), yy) > 0 Then Rows(I).Delete
Next I
End Sub作者: Hsieh 時間: 2017-11-14 10:30
Sub ex()
Set a = Columns("A").Find("單別*")
Do Until a Is Nothing
a.EntireRow.Delete
Set a = Columns("A").Find("單別*")
Loop
End Sub作者: jsc0518 時間: 2017-11-14 11:00
回復 2#Hsieh
Hi 感謝您的回覆,TEST OK
讓我學會了*的用法
謝謝您!作者: jsc0518 時間: 2022-4-19 21:31
Sub ex()
Set a = Columns("B").Find("0")
Do Until a Is Nothing
a.EntireRow.Delete
Set a = Columns("B").Find("0")
Loop
End Sub作者: samwang 時間: 2022-4-20 08:36
請測試看看,謝謝
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作者: jsc0518 時間: 2022-4-20 21:42
回復 5#samwang
Dear samwang,
Test OK,感謝您的熱心解惑。
與您請教:若需更改關鍵字是否更改下列語法