Tip: Other languages are Google-Translated. You can visit the English version of this link.
Log in


How to highlight all named ranges in Excel?

For some purpose, in Excel, we may always create some range names for a range of cells. Sometimes, we want to know where the named ranges are in the whole workbook and highlight them. The simplest way for us is to click the range names from the Name Box to select the range and fill color to it. But, if there are lots of named ranges in the workbook, this method will be time-consuming. How could we highlight all of the named ranges in Excel at once?

Highlight all named ranges with VBA code

arrow blue right bubble Highlight all named ranges with VBA code

Here is a code to highlight all the named ranges in a workbook, you can do as this:

1. Hold down the ALT + F11 keys, and it opens the Microsoft Visual Basic for Applications window.

2. Click Insert > Module, and paste the following code in the Module Window.

VBA code: Highlight all named ranges in Excel

Sub HighlightRange()
'Update 20140317
Dim xName As Name
Dim Rng As Range
On Error Resume Next
For Each xName In Application.ActiveWorkbook.Names
    Set Rng = xName.RefersToRange
    Rng.Interior.ColorIndex = 6
End Sub

3. Then press F5 key to execute this code, and all the named ranges have been highlighted with yellow color in the whole workbook.


1. If you want to fill the named ranges with other colors, you just need to change the ColorIndex = 6 as you like.

2. After applying this code, all the original color in the named ranges are canceled and covered by this new color.

Related articles:

How to highlight all subtotal rows at once in Excel?

How to highlight all error cells in Excel?

How to highlight cells with external links in Excel?

Recommended Productivity Tools for Excel

Kutools for Excel Helps You Always Finish Work Ahead of Time, and Stand Out From Crowd

  • More than 300 powerful advanced features, designed for 1500 work scenarios, increasing productivity by 70%, give you more time to take care of family and enjoy life.
  • No longer need memorizing formulas and VBA codes, give your brain a rest from now on.
  • Become an Excel expert in 3 minutes, Complicated and repeated operations can be done in seconds, 
  • Reduce thousands of keyboard & mouse operations every day, say goodbye to occupational diseases now.
  • 110,000 highly effective people and 300+ world-renowned companies' choice.
  • 60-day full features free trial. 60-day money back guarantees. 2 years of free upgrade and support.

Brings Tabbed Browsing and Editing to Microsoft Office, Far More Powerful Than The Browser's Tabs

  • Office Tab is designed for Word, Excel, PowerPoint and Other Office Applications: 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!


Say something here...
symbols left.
You are guest ( Sign Up? )
or post as a guest, but your post won't be published automatically.
Loading comment... The comment will be refreshed after 00:00.

Be the first to comment.