This post contains VBA macro example on how to remove the color of sheet tabs using Microsoft Visual Basic for Applications in Microsoft Excel. We will loop through all worksheets using FOR-NEXT and will set the sheet's tab color to None. If you are new to the VBA macros in MS Excel, follow these instructions:
How to use? To run these macros, simply press F5 while placing the cursor inside the macro code.
OR From MS Excel window, press 'Alt+F8' to select the macro and then hit the 'Run' button.
References For more information about the properties and Excel constants used inside the above macros, type the following text on a module sheet:
Supported versions of MS Excel: APPLIES TO
- Create a new or blank Excel workbook.
- Press ALT+F11 to open the Visual Basic Editor in MS Excel.
- Go to 'Insert' in the Menu --> Select 'Module'.
- Copy and Paste any or all of the following macro in the new module sheet.
Sub RemoveColorSheetsTabs()
'This macro will remove color from sheet's tabs of the Active Workbook.
Dim mySheet As Worksheet
For Each mySheet In ActiveWorkbook.Sheets
mySheet.Tab.ColorIndex = xlColorIndexNone
Next
End Sub
How to use? To run these macros, simply press F5 while placing the cursor inside the macro code.
OR From MS Excel window, press 'Alt+F8' to select the macro and then hit the 'Run' button.
References For more information about the properties and Excel constants used inside the above macros, type the following text on a module sheet:
- mySheet.Tab
- Tab.ColorIndex
- xlColorIndexNone
Supported versions of MS Excel: APPLIES TO
- Microsoft Office Excel 2016
- Microsoft Office Excel 2013
- Microsoft Office Excel 2010
- Microsoft Office Excel 2007
- Microsoft Office Excel 2007
- Microsoft Office Excel 2003
- Microsoft Excel 2002 Standard Edition
- Microsoft Excel 2000 Standard Edition
Comments