ワークシートでゼロ値を非表示にする
Contents
[
Hide
]
時折、スプレッドシートでゼロ値を非表示にする必要があります。これは個人の好みである場合もありますし、書式設定の基準である場合もあります。
Microsoft Excel でワークシートでゼロ値を非表示にするには:
- ツール メニューから オプション を選択し、次に 表示 タブを選択します。
- ゼロ値 オプションを選択解除します。
- OK をクリックします。
Aspose.Cells を使用してゼロを非表示にするデモンストレーションとなるサンプルコードを以下に示します。
This file contains 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
// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-.NET | |
// The path to the documents directory. | |
string dataDir = RunExamples.GetDataDir(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); | |
// Create a new Workbook object | |
Workbook workbook = new Workbook(dataDir + "book1.xlsx"); | |
// Get First worksheet of the workbook | |
Worksheet sheet = workbook.Worksheets[0]; | |
// Hide the zero values in the sheet | |
sheet.DisplayZeros = false; | |
// Save the workbook | |
workbook.Save(dataDir + "outputfile.out.xlsx"); |