返回列表 上一主題 發帖

[發問] 如何縮短判斷條件刪除速度?

[發問] 如何縮短判斷條件刪除速度?

請問各位大大
目前有個統計表
要刪除所包含列中空白 .指定文字.相似文字等條件的資料
但似乎跑的時間有點久  不知可否幫忙是否有可精進之處?
For i = [a5000].End(xlUp).Row To 6 Step -1
If Cells(i, "A")="" _
Or Left(Cells(i, 1), 4) = "資料" _
Or Left(Cells(i, 1), 2) = "單位" _
Or Left(Cells(i, 1), 3) = "單 位" _
Or Left(Cells(i, 1), 4) = "單  位" _
Or Left(Cells(i, 1), 5) = "單   位" _
Or Left(Cells(i, 1), 6) = "單    位" _
Or Left(Cells(i, 1), 2) = "備註" _
Or Left(Cells(i, 1), 3) = "備 註" _
Or Left(Cells(i, 1), 2) = "幹事" _
Or Left(Cells(i, 1), 2) = "技士" _
Or Left(Cells(i, 1), 2) = "技佐" _
Or Left(Cells(i, 1), 2) = "組員" _
Or Left(Cells(i, 1), 2) = "課員" _
Or Left(Cells(i, 1), 5) = "治療師" _
Or Left(Cells(i, 1), 5) = "工作師" _
Or Left(Cells(i, 1), 5) = "治療師" _
Or Left(Cells(i, 1), 5) = "營養師" _
Or Left(Cells(i, 1), 3) = "助理" _
Or Left(Cells(i, 1), 3) = "佐理" _
Or Left(Cells(i, 1), 3) = "管理" _
Or Left(Cells(i, 1), 4) = "事務" _
Or Left(Cells(i, 1), 4) = "組長" _
Or Left(Cells(i, 1), 4) = "主任" _
Or Left(Cells(i, 1), 4) = "業務" _
Or Left(Cells(i, 1), 4) = "行政" _
Or Cells(i, 1).Value = "備註: 迄時欄位顯示" _
Or Cells(i, 1).Value = "職稱" _
Or Left(Cells(i, 1), 2) = "查詢" Then
    Rows(i).Delete
End If
Next i

感謝指導修正程式   獲益良多

TOP

        靜思自在 : 【時間如鑽石】時間對一個有智慧的人而言,就如鑽石般珍貴;但對愚人來說,卻像是一把泥土,一點價值也沒有。
返回列表 上一主題