KutoolsforOffice — One Suite. Five Tools. Get More Done.February Sale: 20% Off

How to change comment indicator color in Excel?

AuthorXiaoyangLast modified

By default, whenever you insert a comment in Excel, a small red triangle appears at the top right corner of the cell. This triangle acts as an indicator to show that the cell contains a comment. However, in many cases, you may wish to customize the color of these indicators—perhaps to match your company branding, categorization schemes, or to make comments stand out more clearly on shared workbooks. While Excel does not offer a built-in option for changing the color of the comment indicator directly, this article presents a practical workaround that enables you to achieve this effect using VBA code.

Changing the comment indicator color is particularly useful in collaborative environments or when managing complex spreadsheets with multiple comments. Customizing the indicators can help visually organize feedback, differentiate types of comments, or simply personalize your worksheet for easier review. Below, you'll find detailed instructions and notes for this workaround solution. Additionally, you'll find tips for troubleshooting, customizing the VBA, and alternative methods if VBA is restricted in your environment.

Change comment indicator color with VBA code


Change comment indicator color with VBA code

There is currently no direct feature in Excel that allows users to quickly change the color of comment indicator triangles. However, you can use VBA to creatively overlay a colored triangular shape on top of the default indicator, effectively changing its appearance. This approach works for all commented cells on the active worksheet. It is important to note that this method does not actually alter the native comment indicator's color, but functions by visually covering it with a triangle shape of your chosen color.

This method is ideal for users looking for a straightforward way to visually distinguish comment indicators, without the need for extensive manual formatting. If you routinely share workbooks, or if you want to color-code comments by type or author, using VBA can provide the visual customization you need. The advantage of using VBA is the ability to apply your changes across many cells quickly; the downside is that it requires macro permissions and is not native to Excel. Also, if you have sheet protection enabled, you may need to unprotect the sheet before running the VBA code.

1. Open the worksheet where you want to customize your comment indicators' color.

2. Press ALT + F11 to open the Microsoft Visual Basic for Applications window. This shortcut can be used in any Excel workbook and brings up your VBA editor environment.

3. In the VBA window, click Insert > Module to create a new module, then copy and paste the following VBA code into the module window. This code will detect cells with comments and draw a colored triangle shape on each indicator.

VBA code: Change comment indicator color in active sheet

Sub CoverCommentIndicator()
'Update 20141110
Dim pWs As Worksheet
Dim pComment As Comment
Dim pRng As Range
Dim pShape As Shape
Set pWs = Application.ActiveSheet
wShp = 6
hShp = 4
For Each pComment In pWs.Comments
  Set pRng = pComment.Parent
  Set pShape = pWs.Shapes.AddShape(msoShapeRightTriangle, pRng.Offset(0, 1).Left - wShp, pRng.Top, wShp, hShp)
  With pShape
    .Flip msoFlipVertical
    .Flip msoFlipHorizontal
    .Fill.ForeColor.SchemeColor = 12
    .Fill.Visible = msoTrue
    .Fill.Solid
    .Line.Visible = msoFalse
  End With
Next
End Sub

4. Once you have pasted the code, press F5 (or click the "Run" button in the VBA window) to execute. All cell comment indicators on your active worksheet will then be visually covered by triangles of the specified color—as illustrated below:

a screenshot showing the original data
a screenshot of an arrow
a screenshot showing the comments with indicator color changed

Notes and Tips:

1. In the code, the triangle color is set using .Fill.ForeColor.SchemeColor =12. You can modify 12 to another color index to suit your preferences. For example, changing it to 10 will use a different shade. Refer to the official Excel ColorIndex documentation to explore available color scheme numbers.

2. The custom triangle shapes are anchored to the cell corner but may change size or position if you resize or move the underlying cells. For best results, finalize your cell sizes before running the code, or re-run the VBA code if you've resized your sheet.

3. If you need to remove all colored triangle shapes instantly (without removing your actual comments), run the following VBA code, which deletes only those triangles added by the previous script. This is useful if you want to restore the default red indicators or adjust the color again.

VBA code: Remove triangular shapes over the comment indicators

Sub RemoveIndicatorShapes()
'Update 20141110
Dim pWs As Worksheet
Dim pShape As Shape
Set pWs = Application.ActiveSheet
For Each pShape In pWs.Shapes
    If Not pShape.TopLeftCell.Comment Is Nothing Then
      If pShape.AutoShapeType = msoShapeRightTriangle Then
        pShape.Delete
      End If
    End If
Next
End Sub

To run the removal code, follow the same steps above: open the VBA editor, insert a module, paste the code, and execute with F5. This keeps your underlying comment data intact and only deletes the indicator shapes.

If you encounter an error when running either script, double-check that macros are enabled in your Excel settings, the sheet is not protected, and that you do not have objects locked on your worksheet. Also, make sure to save your work before running VBA in case you wish to undo the changes.

If you are working within an organization where running macros is restricted or you prefer not to use VBA, consider highlighting comment cells with conditional formatting as an alternative for visual identification, though this will not change the triangle color itself. Another workaround is to use shapes or icons manually to mark commented cells.


Related articles:

How to highlight all cells with comments in Excel?

How to show or hide all comments and comment indicators in Excel?


Best Office Productivity Tools

🤖Kutools AI Aide: Revolutionize data analysis based on: Intelligent Execution   |  Generate Code  |  Create Custom Formulas  |  Analyze Data and Generate Charts  |  Invoke Kutools Functions
Popular Features: Find, Highlight or Identify Duplicates   |  Delete Blank Rows   |  Combine Columns or Cells without Losing Data   |  Round without Formula ...
Super Lookup: Multiple Criteria VLookup    Multiple Value VLookup  |   VLookup Across Multiple Sheets   |   Fuzzy Lookup ....
Advanced Drop-down List: Quickly Create Drop Down List   |  Dependent Drop Down List   |  Multi-select Drop Down List ....
Column Manager: Add a Specific Number of Columns  |  Move Columns  |  Toggle Visibility Status of Hidden Columns  |  Compare Ranges & Columns ...
Featured Features: Grid Focus   |  Design View   |  Big Formula Bar    Workbook & Sheet Manager   |  Resource Library (Auto Text)   |  Date Picker   |  Combine Worksheets   |  Encrypt/Decrypt Cells    Send Emails by List   |  Super Filter   |   Special Filter (filter bold/italic/strikethrough...) ...
Top 15 Toolsets12 Text Tools (Add Text, Remove Characters, ...)   |   50+ Chart Types (Gantt Chart, ...)   |   40+ Practical Formulas (Calculate age based on birthday, ...)   |   19 Insertion Tools (Insert QR Code, Insert Picture from Path, ...)   |   12 Conversion Tools (Numbers to Words, Currency Conversion, ...)   |   7 Merge & Split Tools (Advanced Combine Rows, Split Cells, ...)   |   ... and more
Use Kutools in your preferred language – supports English, Spanish, German, French, Chinese, and 40+ others!

Supercharge Your Excel Skills with Kutools for Excel, and Experience Efficiency Like Never Before. Kutools for Excel Offers Over 300 Advanced Features to Boost Productivity and Save Time.  Click Here to Get The Feature You Need The Most...


Office Tab Brings Tabbed interface to Office, and Make Your Work Much Easier

  • Enable tabbed editing and reading in Word, Excel, PowerPoint, Publisher, Access, Visio and Project.
  • Open and create multiple documents in new tabs of the same window, rather than in new windows.
  • Increases your productivity by 50%, and reduces hundreds of mouse clicks for you every day!

All Kutools add-ins. One installer

Kutools for Office suite bundles add-ins for Excel, Word, Outlook & PowerPoint plus Office Tab Pro, which is ideal for teams working across Office apps.

ExcelWordOutlookTabsPowerPoint
  • All-in-one suite — Excel, Word, Outlook & PowerPoint add-ins + Office Tab Pro
  • One installer, one license — set up in minutes (MSI-ready)
  • Works better together — streamlined productivity across Office apps
  • 30-day full-featured trial — no registration, no credit card
  • Best value — save vs buying individual add-in