excel自动筛选

In Excel 2003, and earlier versions, an AutoFilter allows only two criteria for each column. In Excel 2007 and later, you can select multiple criteria from each column in the table. See how to apply an Excel AutoFilter with  multiple criteria in a range on the worksheet

在Excel 2003和早期版本中,自动筛选器仅对每个列使用两个条件。 在Excel 2007和更高版本中,您可以从表的每一列中选择多个条件。 在工作表上查看如何应用具有多个条件的Excel自动筛选

自动筛选条件 (AutoFilter Criteria)

In Excel 2003, and earlier versions, if you wanted to filter for multiple criteria, you had to use an Advanced Filter.

在Excel 2003和早期版本中,如果要过滤多个条件,则必须使用Advanced Filter 。

To prepare for an Advanced Filter, list all the criteria on a worksheet, and then use that list (and its heading cell) as the criteria range.

要准备高级筛选器,请在工作表上列出所有条件,然后使用该列表(及其标题单元格)作为条件范围。

In Excel 2007 and Excel 2010, the AutoFilter feature has been improved, and you can select multiple criteria in each column.

在Excel 2007和Excel 2010中,“自动筛选”功能已得到改进,您可以在每列中选择多个条件。

记录自动筛选宏 (Record an AutoFilter Macro)

If you record a macro while selecting criteria in Excel 2007, it will look something like this:

如果您在Excel 2007中选择条件时记录宏,它将看起来像这样:

The criteria are entered as an array, showing all three items that were selected in the drop down list.

标准以数组形式输入,显示在下拉列表中选择的所有三个项目。

创建自己的阵列 (Create Your Own Array)

In the Contextures mail bag this week, someone asked if it's possible to create this type of AutoFilter criteria array from a list on the worksheet. And the answer is yes, you can!

在本周的Contextures邮袋中,有人问是否可以从工作表上的列表中创建这种类型的AutoFilter条件数组。 答案是肯定的,可以!

For this example, there's a dynamic named range -- CritList -- on the Lists worksheet. The items in the CritList range will be used as the AutoFilter criteria array.

在此示例中,“列表”工作表上有一个动态的命名范围 -CritList。 CritList范围内的项目将用作“自动筛选”条件数组。

On the Orders sheet, the fourth column -- Products -- will be filtered using this criteria list.

在“订单”表上,第四列-产品-将使用此条件列表进行过滤。

带数组的自动过滤代码 (AutoFilter Code With Array)

In an Excel VBA procedure, you can create a variable to store the values from the CritList named range. Define this variable as a Variant, and it will store the values as an array.

在Excel VBA过程中,您可以创建一个变量来存储CritList命名范围中的值。 将该变量定义为Variant,然后将值存储为数组。

vCrit = rngCrit.Value

Then, to use this variable as the AutoFilter criteria list, transpose the array, so it's read as a row, instead of a column. If you don't transpose the array, only the first item would be used in the criteria array. (Or, create your worksheet list in a row, instead of a column, and you won't have to transpose it.)

然后,要将此变量用作“自动筛选”条件列表,请转置数组,以便将其读取为行而不是列。 如果不转置数组,则条件数组中仅会使用第一项。 (或者,在一行中而不是在列中创建工作表列表,而不必进行转置。)

Criteria1:=Application.Transpose(vCrit)

Here's the complete code for the AutoFilter:

这是自动筛选的完整代码:

Sub FilterRangeCriteria()
Dim vCrit As Variant
Dim wsO As Worksheet
Dim wsL As Worksheet
Dim rngCrit As Range
Dim rngOrders As Range
Set wsO = Worksheets("Orders")
Set wsL = Worksheets("Lists")
Set rngOrders = wsO.Range("$A$1").CurrentRegion
Set rngCrit = wsL.Range("CritList")
vCrit = rngCrit.Value
rngOrders.AutoFilter _
Field:=4, _
Criteria1:=Application.Transpose(vCrit), _
Operator:=xlFilterValues
End Sub

下载自动过滤器阵列示例文件 (Download the AutoFilter Array Sample File)

To see the sample code and the named range, download my AutoFilter Criteria Array sample file.

要查看示例代码和命名范围,请下载我的AutoFilter Criteria Array示例文件

The file is in xlsm format, zipped, and you can enable macros when you open the file. _________

该文件为xlsm格式,已压缩,打开文件时可以启用宏。 _________

翻译自: https://contexturesblog.com/archives/2010/12/15/excel-autofilter-with-criteria-in-a-range/

excel自动筛选


http://www.taodudu.cc/news/show-4988775.html

相关文章:

  • Ecology Letters:生物多样性的多维性、尺度依赖性及稀疏曲线的深度认知
  • Nature: 生物多样性既会增加、也会降低生态系统稳定性
  • 转载:森林生物量、碳储量的遥感反演与计算
  • Google Earth Engine ——用GPP和NPP计算生物量(朝鲜为例)
  • Google Earth Engine(GEE)——GEDI L4B全球地表生物量密度1000m分辨率数据集
  • Google Earth Engine(GEE)——山西省生物量计算
  • chloris.earth ——Chloris 全球生物量 2003 - 2019 数据平台
  • 生物量
  • Windows在虚拟机安装苹果MacOS系统
  • virtualbox7虚拟机中安装苹果macOS big sur系统详细教程
  • linux vbox安装mac os,使用virtualbox虚拟机安装macos和linux系统
  • 黄海高程和绝对高程之间的转换
  • QGIS如何将高程DEM统一增加数值
  • CAD高程点转入ArcGIS
  • lisp标定高程_基于Auto Lisp的局部高程点批量检查与修改技术
  • 每日一词20190311——高程(altitude或elevation)
  • 苹果cms怎么一键批量删除采集的视频资源
  • 【WEB】aspcms漏洞利用
  • 苹果cms采集后无法播放原因排查及解决教程
  • 基于苹果CMS系统的双端视频播放APP源码+视频教程
  • web安全-xss弹弹弹
  • CEO、COO、CFO、CTO、CXO
  • 调查了全球1200多名CEO后,毕马威发布《2017年全球CEO展望报告》
  • 调研发现,CEO对全球经济增长的悲观情绪创新高
  • 不想当业务员的培训经理不是好的CEO
  • 清华大学有色金属产业(CEO)高级工商管理研修班(五期)
  • 从美团实习生到上市公司CEO,沈鹏的自我训练心法
  • 从卖电脑到卖服务应从培训CEO开始
  • 使用vue+elementUi+springBoot实现图片上传,图片删除,图片展示
  • APP后台上传Nginx+Tomcat服务器后图片可以上传但无法访问问题解决

excel自动筛选_具有范围内条件的Excel自动筛选相关推荐

  1. 左侧固定右侧自动填充_办公小技巧:解决Excel公式自动填充问题

    在Excel表格中,利用公式可以大大提高计算效率,而通过自动填充的方式将公式应用于更多的单元格,则可以再让效率猛增.但在具体使用公式填充的过程中,也可能会遇到一些问题. 1. 向下填充公式时填充柄找不 ...

  2. excel操作练习_你见过最好的Excel教程有哪些?

    教程领到手,学习不用愁!领 答案找一套知识兔Excel教程,学习Excel基本功能,学习Excel高频应用技能--之后很简单,就是反复的练,刻意的练习,不然就多应用.兴趣使然,以应用为导向,学以致用, ...

  3. python 读取excel太慢_实用技巧——Python实现从Excel读取数据并绘制成图像

    喜欢编程,热爱分享,希望能结交更多志同道合的朋友,一起在学习Python的道路上走得更远! 本文主要阐述如何使用python从excel读取数据,并用matplotlib绘制成二维图像. 主要知识点为 ...

  4. JAVA实现Excel照相机功能_​教大家如何设置调用Excel照相机功能

    近日有关于如何设置调用Excel照相机功能的问题受到了很多网友们的关注,大多数网友都想要知道如何设置调用Excel照相机功能的具体情况,那么关于到如何设置调用Excel照相机功能的相关信息,小编也是在 ...

  5. python合并excel工作簿_使用Python将多个excel的多个sheet页合并到一个excel

    使用Python将多个excel的多个sheet页合并到一个excel ##读取Excel文件 import xlrd ##将文本写入excel文件 import xlsxwriter ##读取exc ...

  6. excel填充序列_怎样从零基础学习Excel

    学习Excel最重要的是多动手,多实践,动手实践一次比看100遍视频还强.接下来是如何系统学习Excel,根据Excel的应用,可以将Excel划分成:软件操作.函数进阶.图表基础.数据透视表.实战应 ...

  7. excel切片器_数据透视表真的是Excel中最强大的功能么?

    如果在Excel中选最一个最强大的功能,90% 的人都会跟你说数据透视表. 到底数据透视表可能做哪些事情呢? 数据透视表可以帮助我们批量处理数据.呈现数据,Excel使用者对它的好感度爆棚啦.话不多说 ...

  8. excel查找功能_如何使用VBA代码实现Excel的查找和替换功能?

    每天一篇Excel技术图文微信公众号:Excel星球NO.145-I Find You作者:看见星光微博:EXCELers / 知识星球:Excel HI,大家好,我是星光.这章继续给大家分享VBA常 ...

  9. 15个常用excel函数公式_项目上最常用的Excel函数公式大全,现在看还不晚

    做工程的免不了要做资料算量,Excel是工作中最常用的工具之一.只要搞清楚它的一些使用小技巧,工作效率那是嗖嗖的往上蹭啊.下面这些,你就绝对不能错过! 一.数字处理 1.取绝对值 =ABS(数字) 2 ...

最新文章

  1. 把我坑惨的一个update语句!
  2. paper 38 :entropy
  3. OpenCV 霍夫线检测
  4. spring整合redis缓存
  5. 执行git命令时提示秘钥权限太开放‘Permissions 0644 for ‘/Users/liuml/.ssh/id_rsa_tz‘ are too open.’
  6. Android官方开发文档Training系列课程中文版:构建第一款安卓应用之工程创建
  7. 产品经理如何避免被程序员打?
  8. 基于tornado的爬虫并发问题
  9. struts教程笔记6
  10. Oracle---PL/SQL 基础知识
  11. 软件测试肖sir__简历模板制作
  12. (226)FPGA入门推荐书籍
  13. 帅某---FPGA---黑金
  14. 2010年中国城市人均GDP排名
  15. oracle sparc 服务器系统,oracle sparc服务器基础及管理.pdf
  16. H3C 802.11n的频宽模式
  17. 【数电】(四)逻辑门电路
  18. 神经网络多分类的实现总结
  19. Nginx代理——正向、反向代理,动静分离和负载均衡
  20. 一款好用的tomcat插件---TomcatPlugin插件

热门文章

  1. 基于人脸识别的课堂签到管理系统第一天学习
  2. 基于html+css3酷炫动态罗盘时钟特效
  3. 拓嘉启远:拼多多价格体系有哪些需要了解的
  4. matlab电力系统潮流计算,基于MATLAB的电力系统潮流计算
  5. iOS语音通话功能实现流程(实时语音通话二)
  6. 互联网摸鱼日报(2023-03-03)
  7. mysql的load data_【MySQL】load data语句详解(一)
  8. Matlab中如何对曲线进行微分,Excel 微分(怎么用excel做一阶微分)
  9. C51单片机 波特率选择 和 串口的工作方式
  10. QML应用动画(Applying Animations)