Hiding the Display of Zero Values in the Worksheet
Contents
[
Hide
]
Sometimes, you need to hide zero values in a spreadsheet. It might be a personal preference or a formatting standard.
How to Hide Zero Values in Excel
To hide zero values in a worksheet in Microsoft Excel (for example Microsoft Excel 2003):
- From the Tools menu, select Options, and then select the View tab.
- Deselect the Zero values option.
- Click OK.
How to Hide Zero Values with Aspose.Cells for Python Excel Library
Please see the following sample code that demonstrates hiding zeros using 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") |