如何使用OpenPYXL设置数据透视表使用的单元格值作为过滤器值

时间:2020-01-21 18:14:15

标签: python excel openpyxl

我正在尝试通过设置相应的单元格值以编程方式为数据透视表设置过滤器值。

这是我的工作表的样子:

enter image description here

这是我代码的要旨:

# modify the filter value on the worksheet through the cell
worksheet["B1"].value = 3

在保存并再次在Excel中打开工作簿后,该值仍为(All)

这不是实现目标的正确方法吗?

我正在使用:

  • python@3.8
  • openpyxl@3.0.3

0 个答案:

没有答案
相关问题