excel子表与母表筛选

To see specific data in an Excel Table, you can select an item from the drop down filter in a column heading. Someone asked me if there was a way to scroll through the items, instead of opening the filter list each time. This technique uses a pivot table, which could be hidden on a different sheet, and a spin button, to go up or down in the list of items.

要在Excel表中查看特定数据,可以从列标题的下拉过滤器中选择一个项目。 有人问我是否有办法滚动这些项目,而不是每次都打开过滤器列表。 此技术使用可隐藏在不同工作表上的数据透视表和旋转按钮在项目列表中上移或下移。

滚动浏览过滤器项目演示 (Scroll Through Filter Items Demo)

This animated screen shot shows how the scrolling technique works.

此动画屏幕快照显示了滚动技术的工作原理。

  • Click the Up button, to filter by the next product in the list单击向上按钮,以按列表中的下一个产品过滤
  • Click the Down button, to filter by the previous product in the list单击向下按钮,以按列表中的上一个产品过滤
  • When you reach the beginning or end of the list, the next selection is "All"当您到达列表的开头或结尾时,下一个选择是“全部”

为什么要使用旋转按钮? (Why Use Spin Buttons?)

I wrote the original code for this technique long ago, to scroll through items in a pivot table report filter. Slicers hadn't been invented yet, and the spin button was a quick way to filter a pivot table.

我很早以前就编写了该技术的原始代码,以滚动查看数据透视表报表过滤器中的项目。 切片器尚未发明,旋转按钮是一种筛选数据透视表的快速方法。

Now you can use Slicers to filter a pivot table or Excel table, but they take up a lot of space on a worksheet. A Spin Button is a compact way to go through a list of items, in alphabetical order.

现在,您可以使用切片器来筛选数据透视表或Excel表,但是它们会占用工作表上的大量空间。 旋转按钮是一种紧凑的方式,可以按字母顺序浏览项目列表。

In this screen shot, you can see the size of the Spin Button, compared to a Slicer for the Product field.

在此屏幕快照中,您可以看到“旋转”按钮的大小,与“产品”字段的“切片器”相比。

如何设置旋转按钮 (How to Set Up the Spin Buttons)

First, I added an ActiveX Spin Button on the worksheet – there are detailed instructions on the Report Filter Macros page of my website.

首先,我在工作表上添加了ActiveX旋转按钮-网站的“报告过滤器宏”页面上有详细说明。

Next, I added code to the Spin Button – right-click on it, and click View Code.

接下来,我在“旋转按钮”中添加了代码-右键单击它,然后单击“查看代码”。

Select the SpinUp and SpinDown procedures, and add two macro names in each procedure.

选择SpinUp和SpinDown过程,并在每个过程中添加两个宏名称。

创建数据透视表 (Create a Pivot Table)

The macros will change the selected item in a pivot table's report filter, and then change the selected item in the Excel Table's Product column filter.

宏将更改数据透视表的报表过滤器中的选定项目,然后更改Excel表的产品列过滤器中的选定项目。

Create a pivot table, based on the Excel table that you want to filter. You can put the pivot table on the same worksheet, or on a different sheet. In the sample file, the pivot table is on the same sheet, so it's easier to see how the technique works.

根据要过滤的Excel表创建数据透视表。 您可以将数据透视表放在相同的工作表或不同的工作表上。 在示例文件中,数据透视表在同一张纸上,因此更容易了解该技术的工作原理。

The only field in the pivot table is Product, in the Report Filter area. In the screen shot below, you can see all the items in the Product field.

数据透视表中唯一的字段是“报表过滤器”区域中的“产品”。 在下面的屏幕快照中,您可以在“产品”字段中查看所有项目。

添加数据透视表宏 (Add the Pivot Table Macros)

Next, you'll add two macros – PivotPageUp and PivotPageDown. The code is in the sample file (on the modPivot module), and on the Report Filter Macros page of my website. Store this code in a regular code module.

接下来,您将添加两个宏– PivotPageUp和PivotPageDown。 代码在示例文件中(在modPivot模块上)以及我网站的“报告过滤器宏”页面上。 将此代码存储在常规代码模块中。

  • The code gets the current item number, then adds or subtracts 1, to get the new item number.该代码获取当前商品编号,然后加或减1,以获取新商品编号。
  • It shows that item, or shows "All", if the previous item was at the beginning or end of the list.它显示该项目,或者如果上一个项目在列表的开头或结尾,则显示“全部”。

添加更改筛选器宏 (Add the Change Filter Macro)

The final macro is named ChangeFilter, and it  is stored on a regular code module. The code is in the sample file, on the modFilter module.

最后一个宏名为ChangeFilter,它存储在常规代码模块中。 该代码位于modFilter模块上的示例文件中。

  • This macro gets the name of the current page in the pivot table's Report Filter.此宏获取数据透视表的报表过滤器中当前页面的名称。
  • It selects that item in the Excel Table's Product column, or clears the filter, if "All" is selected.如果选择了“全部”,它将在Excel表的“产品”列中选择该项目,或者清除过滤器。

下载样本文件 (Download the Sample File)

To see how the macros scroll through filter items in an Excel Table, download the sample file from my website. In the Download section on the Report Filter Macros page, look for the download named Pivot Spinner Table Filter.

若要查看宏如何滚动浏览Excel表格中的筛选器项目,请从我的网站下载示例文件。 在“ 报表筛选器宏”页面上的“下载”部分中,查找名为“ 数据透视器微调器表格筛选器”的下载。

The zipped file is in xlsm format, and contains macros. To test the code, enable macros when you open the file.

压缩文件为xlsm格式,并包含宏。 要测试代码,请在打开文件时启用宏。

翻译自: https://contexturesblog.com/archives/2018/01/04/scroll-through-filter-items-in-excel-table/

excel子表与母表筛选


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

相关文章:

  • 【Java 数据结构 算法】宁可累死自己, 也要卷死别人 12 红黑树
  • 数据结构练手小项目(AVL树、哈希表、循环链表、MySQL数据库)
  • 我们到底该如何学习《数据结构与算法》?
  • Python基础之控制结构
  • 分支结构与循环结构
  • 【数据结构】八大经典排序(两万字大总结)
  • 两万字搞定《数据结构》 八大排序 必读(建议收藏)
  • 【牛客网】NC31 第一个只出现一次的字符 01
  • html页面特效是怎么做的,HTML5实现晶莹剔透的雨滴特效
  • Java中 List、Set、Map 之间的区别
  • IDEA Maven 依赖分析插件Maven Helper
  • maven-surefire-plugin
  • Maven入门---如何在idea中配置Maven
  • 安装Maven(apache-maven-3.8.6)支持,使用Maven的前提
  • Maven - 2、安装、配置、mvn运行过程详解
  • jenkins中maven的安装及配置,如何在jenkins中创建maven任务。
  • Maven基础(2):Maven详解
  • 安装配置Maven构建工具
  • 正则中的\d与\D、\w与\W、\s与\S各代表什么意思
  • npm install -D 和-S的意思
  • linux文件的文件类型(d,-,s,b,c,....)和文件权限(r,w,x, s,t,S,T)与文件特殊权限(s,t,S,T)
  • linux中的 -d 、-s 等的含义 文件修改用户 或者权限(rwx)
  • 正则表达式-Java实现 - \d、\D、\w、\W、+、*、?
  • python正则表达式(\S+)和 \d+的含义
  • 正则表达式 \\w \\s \\d \\b
  • 正则表达式 \w \s \d \b
  • Perl匹配之\w \s \d \b
  • linux shell中\w \s \d \b ^ $等常用匹配用法
  • Python正则表达式 .,[],\d,\w,\s,\S,\D,\W的用法
  • 搜题公众号制作简单教学

excel子表与母表筛选_滚动浏览Excel表中的筛选器项目相关推荐

  1. excel自动筛选_自动更改Excel筛选器标题

    excel自动筛选 There was a question about Excel Advanced Filter criteria on the Tech Republic blog recent ...

  2. mysql 表名批量转大写_(转)mysql数据库表名批量修改大小写

    由于不用服务器对mysql的表名的大小写敏感要求不一致,经常在出现线上的数据库down到了本地不能运行的情况,贴出一段代码用来批量修改数据库表名大小写. DELIMITER // DROP PROCE ...

  3. 表单设置默认值_你还不知道表单怎么设计吗?看这里!

    表单是电子商务.社交互动和大多数基于生产力应用类型的网站的关键.尽可能简单,微小的变化都有可能极大的提高用户体验. 一.设计原则 尽量减少痛苦 填写过程尽量简洁.容易. 说明填写完成路径 清晰的告诉人 ...

  4. js导出excel单元格内换行符代码_前端和excel的那些事

    前端和 excel 的那点事 在开发需求中,经常会遇到需要和excel相关的需求,毕竟不是所有人都是程序员,很多的业务都是通过excel去进行数据的整理归类计算的,excel中提供的一系列快捷功能,统 ...

  5. bartender外部表不是预期格式_批量合并Excel数据时“外部表不是预期格式”或“文件包含损坏数据”的两种情况...

    很多朋友在用Power Query合并(汇总)Excel数据时,碰到过"DataFormat.Error:外部表不是预期格式"或"DataFormat.Error:文件包 ...

  6. java表单提交包含文件_如何同时提交表单中的文件和文本

    思路是把表单类型设置为enctype="multipart/form-data",其他表单中文本数据通过javascript处理,附加在action后面,后台通过request.g ...

  7. element 表单回显验证_关于vue el-form表单报错的问题

    在写el-form表单的时候,遇到了蛮多问题,在这里记录一下. 1.表单验证报错[Element Warn][Form]model is required for validate to work! ...

  8. python表单防重复提交_传统方式提交表单,防止重复提交问题?

    提交表单的时候,不是使用ajax提交,就是传统的表单提交,为防止表单重复提交,应该怎么写javascript或jquery代码呢?如果提交没成功,怎么恢复提交按钮? html如下: Email add ...

  9. 注册表usbstor删除不了_彻底清除注册表U盘与USB使用记录技巧

    相信很多用户会在电脑上使用U盘或其他USB外接设备,为了保护自己的使用隐私,也会有很多用户会清理掉USB端口使用记录,但是极少部分用户不清楚U盘在电脑上使用之后,电脑的注册表中也会留下使用记录,下面豆 ...

最新文章

  1. mysqld服务启动失败, Failed to restart mysqld.service: Unit not found.
  2. MyBatis 源码解读-会话创建过程
  3. 基于自定义Mybatis框架实现数据库操作
  4. 【转】TcpListener和tcpclient使用
  5. window8下安装RabbitMQ
  6. Xshell利用密钥远程登录Linux
  7. 华为手机坏了数据怎么导出_更换手机怎么把旧手机便签里的内容怎么全部导出到电脑...
  8. 华为荣耀9x怎么解账户锁_跟华为毫无关系的荣耀为何不值得买?
  9. k2p拆机ttl刷breed_【1.10】k2p A版 22.10.3.42;22.10.3.38;拆机TTL刷BREED;B版 21.6.25.20刷机 图文教程...
  10. 80端口为什么要备案_Nginx只允许域名访问网站,禁止使用IP 访问80,443端口
  11. mac 安装问题汇总
  12. java角谷_[蓝桥杯]角谷猜想问题
  13. 【bluestacks】蓝叠模拟器hyper-v版本提示hyper-v inaccessible
  14. JAVA通过阿里云OSS存储实现图片上传功能
  15. 弥散磁共振影像处理的黎曼 芬斯勒几何方法研究
  16. 怎样两个网络互远程连接计算机,两个电脑怎么远程控制两个方法教你
  17. 多少秒算长镜头_电影中什么是长镜头画面(9个经典长镜头)
  18. win10 安装k8s
  19. 线上流量对比应用实践
  20. 从数理角度理解生活中的“二八定律”

热门文章

  1. 学计算机的普遍字写得都不好,国人普遍写不好汉字的原因探析
  2. 判断两个圆柱体是否相交
  3. Linux生产者消费者模型
  4. ios私钥证书和描述文件.mobileprovision的生成方法
  5. 如何可以把模糊的照片变得高清?
  6. 【Locust】新版本locust使用入门到分布式,附带脚本模板,复制即用。
  7. DDR焊接短路导致内存异常
  8. APS排程软件自动分配任务到多台机台同时生产
  9. 公有云的这五大定律 看看谁能跑得更远?
  10. 2017年,电视到底该怎么买?