如果没有来自的数据,我正在尝试删除一行A:J
我找到了这段代码并试图编辑它,但这最终会删除整个工作表的数据。
任何帮助将不胜感激
Sub DeleteRows()
Dim rngBlanks As Range
Dim i As Integer
For i = 1 To 10
On Error Resume Next
Set rngBlanks = Columns(i).SpecialCells(xlCellTypeBlanks)
On Error GoTo 0
If Not rngBlanks Is Nothing Then
rngBlanks.EntireRow.Delete
End If
Next
End Sub