Excel

TheSmallman.com

an XL ideas Lab

Dashboards VBA
  • Home
  • Dashboards
    • Tips & Tricks
    • Charts
    • Modelling
    • Infographics
    • VBA
  • Shop Dashboards
    • Power Pivot a User Guide
    • Excel Dashboard Course
    • Advanced Dashboard Course
    • Financial Modelling Course
    • Excel VBA Course
  • Blog
  • About
Menu

Excel Dashboards VBA

Street Address
City, State, Zip
Phone Number
an XL ideas Lab

Your Custom Text Here

Excel Dashboards VBA

  • Home
  • Dashboards
  • Excel Tips
    • Tips & Tricks
    • Charts
    • Modelling
    • Infographics
    • VBA
  • Shop Dashboards
  • PowerPivot
    • Power Pivot a User Guide
  • Courses
    • Excel Dashboard Course
    • Advanced Dashboard Course
    • Financial Modelling Course
    • Excel VBA Course
  • Blog
  • About

List All Named Ranges with VBA

February 14, 2015 Marcus Small
Photo by Markus Spiske on Unsplash

Photo by Markus Spiske on Unsplash

There are times where you may have a large number of named ranges in a workbook.  I like to have a general rule when creating a workbook.  No more than half a dozen named ranges.  Formula auditing turns into a nightmare if there are too many named ranges.  You may well know what CapitalExpense refers to when you create the named range but as your file gets 20-30 tabs and a dozen other named ranges, finding CapitalExpense can prove time consuming if you have to go to the name manager continually to tell you the location of the named range.  The following is a simple piece of code which will identify all of the named ranges in a file and show what range the named ranges refer to.

Option Explicit

Sub WkbNames() 'Show all named Ranges in Sheet1.
Dim sh As Worksheet
Dim nm As Name

Set sh=Sheet1 'Ensure you change the sheet reference if applicable
On Error Resume Next

   For Each nm In Names 'Loop through all sheet names.
      sh.Range("A" & Rows.Count).End(xlUp)(2)=nm.Name
      sh.Range("B" & Rows.Count).End(xlUp)(2)="'" & nm.RefersTo
   Next nm
On Error GoTo 0
End Sub

The above VBA coding is a simple procedure which will show all of the named ranges in a file.  The error trap is there just in case there are no named ranges in the file.

← Road Traffic Statistics in Excel Excel Like a Boss →

Featured Posts

Excel Dashboards: Tracking a Crisis

Excel Dashboards: Tracking a Crisis
April 14, 2020

Recent Posts

Populating an Excel Table from a Range of Cells with VBA

Populating an Excel Table from a Range of Cells with VBA June 12, 2025

Fuzzy Distribution with Randbetween

Fuzzy Distribution with Randbetween May 21, 2025

Add Minimum and Maximum for Chart in Cells

Add Minimum and Maximum for Chart in Cells March 12, 2025

Inflation Over Multiple Years in a Single Cell

Inflation Over Multiple Years in a Single Cell January 10, 2025

Hubspot Dashboard

Hubspot Dashboard October 3, 2024

Monthly Dashboard With Supporting Metrics

Monthly Dashboard With Supporting Metrics September 25, 2024

Excel Show Missing Sheet Tabs

Excel Show Missing Sheet Tabs July 29, 2024

Run Macro Overnight Automatically

Run Macro Overnight Automatically June 24, 2024

Split File into Parts and Save to Directory

Split File into Parts and Save to Directory April 20, 2024

Most Popular Author

Most Popular Author December 14, 2023

 

Follow US:

 
 

MarcusSmall@thesmallman.com

 

TheSmallman.com - Making your small systems hum...
© Copyright 2013-2024 theSmallman.com All Rights Reserved.