View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Herbert Herbert is offline
external usenet poster
 
Posts: 23
Default VBA code to itemize range names and associations?

Hi Larry,

you can use the property 'RefersTo' of a 'Name' object to return sheet and
cell address.
By the way, there also is a 'Names' collection for worksheets.

Hope this helps,
Herbert


"Larry A" wrote:

I would appreciate any thoughts on how to set up a macro to build an
inventory list of all range names in a spreadsheet with associated sheet
names and cell ranges. What I have so far is:

sub BuildRangeNameList()
dim i as integer, s as string, n as name
for i = 1 to activeworkbook.name.count
set n = activeworkbook.name(i)
s = n.name
next i
end sub

How do I find the associate sheet name? And asociated cell range in
non-R1C1 format?

Thanks in advance. Larry.