headermask image

Business Tools Blog

Two Macros to Help with Named Ranges in Excel

A helpful tip from Zayo’s CFO, Ken desGarennes

This Excel Macro creates a list (first create a blank worksheet) of all of the named ranges in a workbook (both hidden and unhidden).

Sub ListAllNames()
Row = 1
For Each n In ActiveWorkbook.Names
Cells(Row, 1) = n.Name
Cells(Row, 2) = ” ” & n.RefersTo
Row = Row + 1
Next n
End Sub

This Excel Macro unhides the hidden named ranges.

Sub Adjust_Names()

Dim nme As Name

For Each nme In ActiveWorkbook.Names
nme.Visible = True
Next nme

End Sub

Unfortunately all of the macros I tried to use to delete the invalid named ranges did not work – which means you have to do it manually.

If you liked my post, feel free to subscribe to my rss feeds

One Comment

  1. There is a great (and free!) utility that helps with Names in Excel. It’s the Name Manager, by Jan Karel Pieterse, and it’s available from his web site, http://jkp-ads.com.

    This utility makes it easy to change the visibility of names, change scope from worksheet to workbook (and back), find names with errors and delete them, and much more.

    1. Jon Peltier on November 3rd, 2009 at 6:45 am

Post a Comment

Your email is never published nor shared. Required fields are marked *

*
*