我希望在整张117张工作簿中运行以下宏。我尝试过几种不同的研究方法,但是没有成功。我对VBA比较新,所以我可能只是错过了一些小事。
Sub DelNUM()
Dim LR As Long, i As Long
LR = Range("B" & Rows.Count).End(xlUp).Row
For i = LR To 1 Step -1
If IsError(Range("B" & i)) Then Rows(i).Delete
Next i
End Sub
任何建议都将不胜感激。
谢谢
答案 0 :(得分:0)
Sub DelNUM()
Dim LR As Long
Dim i As Long
Dim sh As Worksheet
For Each sh In Worksheets
LR = sh.Range("B" & sh.Rows.Count).End(xlUp).Row
For i = LR To 1 Step -1
If IsError(sh.Range("B" & i)) Then sh.Rows(i).Delete
Next i
Next
End Sub