Select Named Range - Active sheet - Message Box address

  • Thread starter Thread starter al007
  • Start date Start date
A

al007

Am looking for a macro which would give me in message boxes all named
range & address in my active sheet one after the other & finally select
them - something similar as macro below.

Sub FindMergedAreas()
Dim d As Range, myCell As Range
Set d = Nothing
For Each myCell In ActiveSheet.UsedRange
If myCell.MergeCells Then
If d Is Nothing Then
Set d = myCell.MergeArea
MsgBox "First merged area is " & myCell.MergeArea.Address
Else
If Intersect(d, myCell.MergeArea) Is Nothing Then
MsgBox "Another merged area is " & myCell.MergeArea.Address
End If
Set d = Union(d, myCell.MergeArea)
End If
End If
Next myCell
If Not d Is Nothing Then d.Select
End Sub

Can anybody help pls.

Thxs
 
not sure if this is what you wanted or not.

Option Explicit

Sub name_ranges4() ' dumps all named ranges
Dim nm As Name
For Each nm In ThisWorkbook.Names
MsgBox nm.Name & " " & Range(nm).Address
Next nm
End Sub
 
Thxs nearly just what I want - I want to end the macro with all name
ranged selected - what else do I need to add
Thxs
 
Back
Top