第1个回答 推荐于2018-04-26
Sub 筛选后判断()
Dim rng As Range
Dim cng As Range
Dim arr, r%
r = ActiveSheet.[a65536].End(3).Row
ActiveSheet.Range(Cells(1, 1), Cells(r, 4)).AutoFilter Field:=4, Criteria1:="="
For Each cng In Range("A2", [a65536].End(3)).SpecialCells(xlCellTypeVisible)
Set rng = cng
arr = rng.EntireRow
If arr(1, 5) = "" Then
MsgBox rng.Address
End If
Next
Set rng = Nothing
End Sub
假设第4列是自动筛选列 ,第5列是筛选后需要判断是否为空的列, 第1行为标题行本回答被提问者采纳
第2个回答 推荐于2017-12-16
这个不用筛选吧,
你可以直接用VBA 判断啊
dim i as integer
for i=2 to r
if activesheet.cells(i,4)="" and activesheet.cells(i,5)="" then
debug.print i '打印第4 列,5列都为空的单元格所在行
end if
next本回答被网友采纳