在VBA中使用Autofilter后引用特定的可见单元格

时间:2016-06-28 10:45:42

标签: vba excel-vba autofilter excel

我在使用自动过滤功能后尝试引用特定的可见细胞。虽然自动过滤器似乎工作正常,但我之后无法参考特定的可见细胞。我的代码如下:

        Cells.AutoFilter
        With Range("A1:ZZ100")
            .AutoFilter Field:=j, Criteria1:=i1, Operator:=xlOr, Criteria2:=i2
        End With
        MsgBox Range(.Cells(1, 2), .Cells(100, 2)).SpecialCells(xlCellTypeVisible).Cells(2, 50)
        MsgBox AutoFilter.Range.SpecialCells(xlCellTypeVisible).Cells(2, 50)

MsgBox都给我隐藏的值。请协助

0 个答案:

没有答案