I've come across the Name Manager function. It's pretty decent. However one doesn't get a visual of which areas of the workbook are named. Is there some way to get those parts of the workbook highlighted?
You mean besides clicking the down arrow at the left end of the formula bar and choosing one of the named ranges that displays?Is there some way to get those parts of the workbook highlighted?
You mean besides clicking the down arrow at the left end of the formula bar and choosing one of the named ranges that displays?
[FONT=Fixedsys]Option Explicit[/FONT]
[FONT=Fixedsys]Public Sub HighlightNamedRanges()[/FONT]
[FONT=Fixedsys] Dim oName As Name[/FONT]
[FONT=Fixedsys] Dim mySheet As String[/FONT]
[FONT=Fixedsys] Dim myRange As String[/FONT]
[FONT=Fixedsys] Dim oCell As Range[/FONT]
[FONT=Fixedsys] For Each oName In ThisWorkbook.Names[/FONT]
[FONT=Fixedsys] If InStr(oName.RefersTo, "#REF!") = 0 Then[/FONT]
[FONT=Fixedsys] mySheet = Mid(oName.RefersTo, 2, InStr(oName.RefersTo, "!") - 2)[/FONT]
[FONT=Fixedsys] myRange = Mid(oName.RefersTo, InStr(oName.RefersTo, "!") + 1)[/FONT]
[FONT=Fixedsys] Sheets(mySheet).Range(myRange).Interior.Color = vbYellow[/FONT]
[FONT=Fixedsys] End If[/FONT]
[FONT=Fixedsys] Next oName[/FONT]
[FONT=Fixedsys] MsgBox "WARNING: DON'T SAVE THIS WORKBOOK!" & Space(10), vbOKOnly + vbExclamation[/FONT]
[FONT=Fixedsys]End Sub[/FONT]
[FONT=Fixedsys] Sheets(mySheet).Activate
MsgBox oName.Name & " " & oName.RefersTo
[/FONT]