简体   繁体   English

如何使用VBA从自动过滤器列中删除空白

[英]How to remove blanks from autofilter column using vba

I am preparing some reports which require filtering data from one sheet to another. 我正在准备一些报告,这些报告需要将数据从一张纸过滤到另一张纸。 I used VBA for automating this process. 我使用VBA自动执行此过程。 However, I am facing an issue in filtering. 但是,我在过滤方面遇到了问题。 Just wanted to exclude blank row using Auto Filter. 只是想使用自动过滤器排除空白行。 The below code includes the code to filter However, I want the opposite of the following code. 下面的代码包含要过滤的代码。但是,我希望与下面的代码相反。

    ThisWorkbook.Sheets("Revenue Summary").Range("$K$4:$P$" & lastr)
.AutoFilter Field:=3, Criteria1:="="

In the criteria argument you need to use this: 在条件参数中,您需要使用以下命令:

.AutoFilter Field:=3, Criteria1:="<>"

not this: 不是这个:

.AutoFilter Field:=3, Criteria1:="="

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM