|
本帖最后由 jiangjian1380 于 2018-7-3 10:55 编辑
Sub sckb() '删除空白行或者0行
Dim S1 As Worksheet
Dim arr, brr(), i&, rng As Range
Set S1 = Worksheets(1)
'For i = 2 To S1.[a65536].End(xlUp).Row
If IsNull(S1.Cells(i, 7)) And IsNull(S1.Cells(i, 8)) Or (S1.Cells(i, 7) = 0 And S1.Cells(i, 8) = 0) Then
If rng Is Nothing Then
Set rng = S1.Cells(i, 1)
Else
Set rng = Union(rng, S1.Cells(i, 1))
End If
End If
Next i
rng.EntireRow.Delete '一次刪除所有不符条件的行
End Sub
以上代码出现运行是错误“91”,对象变量或With变量未设置的提示。之前用没有问题的,但是用着出现错误了,求助
12354.rar
(16.47 KB, 下载次数: 3)
|
|