本帖最后由 scl5801 于 2016-7-23 15:24 编辑
看看行不
Public Sub 找空()
Dim ar, i, s
ar = Range("a1:a" & Cells(Rows.Count, 1).End(xlUp).Row)
100
For i = UBound(ar) To 1 Step -1
If ar(i, 1) = "" Then
s = s & "," & i & "行"
ElseIf ar(i, 1) = "数量" Then
Exit For
End If
Next i
If i = 1 Then GoTo 101
ar = Range("a1:a" & Cells(i, 1).End(xlUp).Row)
GoTo 100
101
MsgBox "空行有:" & s
End Sub