named cells

  • Thread starter Thread starter ranswert
  • Start date Start date
R

ranswert

Is there a way to write a procedure that will pull all the cell names off a
range of cells and put it into a list?
Thanks
 
Sub listum()
Dim Nm As Name
Set r = Selection
namelist = ""
For Each Nm In ActiveWorkbook.Names
If Intersect(Range(Nm), r) Is Nothing Then
Else
namelist = namelist & "," & Nm.Name
End If
Next
MsgBox (namelist)
End Sub


Forgive the leading comma
 
Thanks I'll give that a try

Gary''s Student said:
Sub listum()
Dim Nm As Name
Set r = Selection
namelist = ""
For Each Nm In ActiveWorkbook.Names
If Intersect(Range(Nm), r) Is Nothing Then
Else
namelist = namelist & "," & Nm.Name
End If
Next
MsgBox (namelist)
End Sub


Forgive the leading comma
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top