VBA:如果范围(X)中存在非空白单元格,则继续执行代码。 否则,结束

我试图把一个Try-Catchtypes的代码行放到我的VBA程序中。 我得到的是以下。 但是,无论是否在列A的单元格中存在数据,此代码都立即运行到End If。我该如何解决此问题?
谢谢。

ActiveSheet.ListObjects("Table1").Range.AutoFilter Field:=11, Criteria1:= _ "0" If Range("A:A").SpecialCells(xlCellTypeVisible).Text = "<>0" _ Then (other code) (other code) (other code) End If 

要查看范围是否包含任何可见的数据:

 Sub hfksjdfh() Dim wf As WorksheetFunction, r As Range Set wf = Application.WorksheetFunction Set r = Range("A:A").Cells.SpecialCells(xlCellTypeVisible) If wf.CountA(r) > 0 Then MsgBox "There is at least one visible cell in column A with data" Else MsgBox "The visible part of column contains no data" End If End Sub