VBA if filter has no data then

Revathi Kannan

New Member
Joined
Jan 27, 2012
Messages
23
Hi all,

Can someone assist me on the below.

> I need to filter the data in column B apart from blanks and delete the entire row.
> If no data found while filtering then i need to release the filters and move on to the next subroutine.

Please assist me that how to implement If condition in auto filter using VBA.
 

Some videos you may like

Excel Facts

Links? Where??
If Excel says you have links but you can't find them, go to Formulas, Name Manager. Look for old links to dead workbooks & delete.

r1998

Board Regular
Joined
Sep 9, 2018
Messages
106
Hello Revathi Kannan
Code:
Sub a()
Dim r As Range
With Worksheets("code")
Range("$A$1:$BE$10").AutoFilter Field:=28, Criteria1:="<>"
Set r = Range("$A$1:$BE$10").SpecialCells(xlVisible)
If r Is Nothing Then
Call subroutine
Exit Sub
End If
End With
End Sub
(y)
 
Last edited:

Watch MrExcel Video

Forum statistics

Threads
1,108,632
Messages
5,523,994
Members
409,554
Latest member
denistrevisan

This Week's Hot Topics

Top