Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
这是我已经拥有的。它在工作表 1 的 B 列中搜索 #N/A 并删除该行。
Sub DeleteErrorRows() On Error Resume Next Range("B:B").SpecialCells(xlCellTypeConstants, 16).EntireRow.Delete On Error GoTo 0 End Sub
我想要的是将该行复制到工作表 2 上然后删除?所以我可以记录被删除的内容。
任何帮助将非常感激。谢谢!
考虑:
Sub DeleteErrorRows() Dim r As Range Set r = Range("B:B").SpecialCells(xlCellTypeConstants, 16).EntireRow r.Copy Sheets("Sheet2").Range("A1") r.Delete End Sub