ワークシートのタブの色を設定
Contents
[
Hide
]
Aspose.Cells では、個々のワークシート タブの色を変更して、他のタブよりも目立つようにすることができます。たとえば、経費を赤、売上を緑、資産を青などにすることができます。
Microsoft Excel でワークシートのタブの色を設定する
- 現在のワークシートの下部にあるタブ シートのタブを右クリックします。
- 選択するタブの色.
- パレットから色を選択します。
- クリックわかった.
タブは赤、緑、青に着色されています
Aspose.Cells でワークシートのタブの色を設定する
以下のサンプル コードは、Aspose.Cells でタブの色を設定する方法を示しています。
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
// 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(SetWorksheetTabColor.class); | |
// Instantiate a new Workbook | |
Workbook workbook = new Workbook(dataDir + "Book1.xls"); | |
// Get the first worksheet in the book | |
Worksheet worksheet = workbook.getWorksheets().get(0); | |
// Set the tab color | |
worksheet.setTabColor(Color.getRed()); | |
// Save the Excel file | |
workbook.save(dataDir + "worksheettabcolor.xls"); |