0
有沒有人有什麼錯這個代碼?當列A到F爲空時,它應該刪除行。謝謝當某些列爲空時刪除行
Sub range_reporter()
Dim n As Long
Dim nLastRow As Long
Dim nFirstRow As Long
ActiveSheet.UsedRange
Set r = ActiveSheet.UsedRange
nLastRow = r.Rows.Count + r.Row - 1
nFirstRow = r.Row
For n = nLastRow To nFirstRow Step -1
If Cells(n, "A") & Cells(n, "B") & Cells(n, "C") & Cells(n, "D") & Cells(n, "E") & Cells(n, "F") = "" Then
Cells(n, "A").EntireRow.Delete
End If
Next n
End Sub
謝謝!謝謝! – user2770097