ワークシートでゼロ値を非表示にする
Contents
[
Hide
]
時には、スプレッドシートのゼロ値を非表示にする必要があります。個人の好みであるか、フォーマットの基準であるかもしれません。
Microsoft Excel でワークシートでゼロ値を非表示にするには:
-
ツール メニューから オプション を選択し、次に 表示 タブを選択します。
-
ゼロ値 オプションを選択解除します。
-
OK をクリックします。
Microsoft Excelでのゼロ値の非表示
以下に、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-Java | |
// The path to the documents directory. | |
String dataDir = Utils.getDataDir(HidingDisplayOfZeroValues.class); | |
// Create a new Workbook object | |
Workbook workbook = new Workbook(dataDir + "book1.xlsx"); | |
// Get First worksheet of the workbook | |
Worksheet sheet = workbook.getWorksheets().get(0); | |
// Hide the zero values in the sheet | |
sheet.setDisplayZeros(false); | |
// Save the workbook | |
workbook.save(dataDir + "output.xls"); |