隐藏工作表中零值的显示
Contents
[
Hide
]
有时,您需要在电子表格中隐藏零值。这可能是个人偏好或格式化标准。
如何在 Excel 中隐藏零值
要在Microsoft Excel中隐藏工作表中的零值(例如Microsoft Excel 2003):
- 从工具菜单中选择选项,然后选择视图选项卡。
- 取消选中零值选项。
- 点击确定。
使用 Aspose.Cells for Python Excel 库隐藏零值的方法
请参见下面的示例代码,演示如何使用 Aspose.Cells for Python via .NET 来隐藏零值。
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from aspose.cells import Workbook | |
# For complete examples and data files, please go to https:# github.com/aspose-cells/Aspose.Cells-for-.NET | |
# The path to the documents directory. | |
dataDir = RunExamples.GetDataDir(".") | |
# Create a new Workbook object | |
workbook = Workbook(dataDir + "book1.xlsx") | |
# Get First worksheet of the workbook | |
sheet = workbook.worksheets[0] | |
# Hide the zero values in the sheet | |
sheet.display_zeros = False | |
# Save the workbook | |
workbook.save(dataDir + "outputfile.out.xlsx") |