View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
JLGWhiz JLGWhiz is offline
external usenet poster
 
Posts: 3,986
Default How Do I list all range names in a worksheet

I found this in VBA help files.
Sub nms()
Set nms = ActiveWorkbook.Names
Set wks = Worksheets(1)
For r = 1 To nms.Count
wks.Cells(r, 2).Value = nms(r).Name
wks.Cells(r, 3).Value = nms(r).RefersToRange.Address
Next
End Sub

"QuietMan" wrote:

I have a spreadsheet with over 1,000 range names. 90% are not valid anymore
I woul like to list all the range names thes be able to have the vba code go
through this list and delet all the ones that I tag as non needed

thanks
--
Helping Is always a good thing