【发布时间】:2020-01-31 11:00:04
【问题描述】:
我有一个 11 张工作簿。我需要删除所有工作表中出现#N/A 的行。我该怎么做呢?
我已经写了一些代码,见下文,它允许我只删除当我的 excel 文件打开到该特定选项卡时出现的 #N/A 行。它不会循环遍历整个工作簿。
Sub RemoveErrorsLoop()
Dim WS_Count As Integer
Dim I As Integer
' Set WS_Count equal to the number of worksheets in the active
' workbook.
WS_Count = ActiveWorkbook.Worksheets.Count
' Begin the loop.
For I = 2 To WS_Count
Cells.SpecialCells(xlCellTypeFormulas, xlErrors).EntireRow.Delete
Next I
End Sub
我想要循环遍历我的所有工作表并删除具有#N/A 的行的代码。感谢您的帮助!
【问题讨论】: