LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #10   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 15
Default VBA code to itemize range names and associations?

Thanks, I will definitely give it a look.

"keepITcool" wrote in message
ft.com...

namemanager is totally legit and has thousands of users.
Jan Karel Pieterse is an MVP and has been for ages.

--
keepITcool
| www.XLsupport.com | keepITcool chello nl | amsterdam


Larry A wrote :

Thank you. I will give this a try. May I ask, to what extent do you
trust the Name Manager add-in? I'm generally reluctant to put
outside code on my machine, but this looks pretty legit and could
prove extremely useful Thanks again. Larry.

==========================
"keepITcool" wrote in message
ft.com...


quoted code assumes that all names refer to ranges.
it will error out when the refersto contains constants or formulas
that do not evaluate to ranges.following should work

Sub ListNames()
Dim v, n&, rng As Range
On Error Resume Next
With ActiveWorkbook.Names
ReDim v(1 To .Count, 1 To 3)
For n = 1 To .Count
With .Item(n)
v(n, 1) = .Name
v(n, 2) = .RefersToR1C1
If Not IsError(.RefersToRange) Then
v(n, 3) = .RefersToRange.Address
End If
End With
Next
End With

Set rng = Application.InputBox("Dump where?", Type:=8)
With rng.Resize(UBound(v, 1), UBound(v, 2))
.NumberFormat = "@"
.Value = v
End With

End Sub


--
keepITcool
www.XLsupport.com | keepITcool chello nl | amsterdam


Roman wrote :

Hi Larry, hope this helps:

Sub BuildRangeNameList()
Dim i As Integer, s As String, n As Name
For i = 1 To ActiveWorkbook.Names.Count
Set n = ActiveWorkbook.Names(i)
s = n.Name
MsgBox "Name: " & s & vbCrLf & _
"sheet: " & n.RefersToRange.Parent.Name & vbCrLf & _
"range: " & Range(n).Address
Next i
End Sub





 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
converting email address names in a range of cells to real names John Excel Worksheet Functions 1 May 19th 10 03:44 PM
using the Excel generic worksheet names instead of user-given names in code Paul Excel Discussion (Misc queries) 5 June 26th 09 08:44 PM
Opening and file associations for Excel Star Excel Discussion (Misc queries) 1 October 6th 05 01:55 PM
Add-In / Tool / VBA Code for Renaming Range Names No Name Excel Programming 1 February 12th 04 07:58 PM
Excel hyperlink file associations - GIF joelet Excel Programming 1 September 28th 03 07:02 AM


All times are GMT +1. The time now is 03:18 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"