Set Worksheet Tab Color in xlsx4j
Contents
[
Hide
]
Aspose.Cells - Set Worksheet Tab Color
Aspose.Cells allows you to change the color of individual worksheet tabs to make them prominent from the rest. For example, you can make Expenses red, Sales green, Assets blue, etc.
Setting Worksheet Tab Color with Microsoft Excel
- Right-click a tab in the tab-sheet at the bottom of the current worksheet.
- Select Tab color.
- Select a color from the palette.
- Click OK.
Java
//Instantiate a new Workbook
Workbook workbook = new Workbook(dataDir + "workbook.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 + "AsposeColoredTab_Out.xls");
Download Running Code
Download Sample Code
For more details, visit Set Worksheet Tab Color.