过滤出特定值 [英] Filtering Out Specific Value

查看:60
本文介绍了过滤出特定值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想过滤出一列中的特定值,但是记录功能似乎仅支持选择要保留的特定值,而不是取出.

I want to filter out a specific value in a column, but the record feature seems to only support selecting specific values to keep instead of take out.

例如,如果该列中填充了事先不知道的任意单词,那么我想确保没有特定的单词.如果一列中填满了水果的名称,我想删除苹果"而不用知道那里其他所有水果的名称.

For example, if the column is filled with arbitrary words not known beforehand, I want to make sure a specific word is not there. If a column was filled with names of fruits, I would want to take out "apple" without having to know the name of every other fruit in there.

我必须选择除苹果"之外的所有水果,以过滤掉苹果".

I would have to select every fruit but "apple" to filter "apple" out.

推荐答案

考虑:

Sub Macro1()
    ActiveSheet.Range("$G$1:$G$21").AutoFilter Field:=1, Criteria1:="<>apple", _
        Operator:=xlAnd
End Sub

仅作为示例.

这篇关于过滤出特定值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆