+ Reply to Thread
Results 1 to 5 of 5

Named Range - help!

Hybrid View

  1. #1
    Forum Contributor
    Join Date
    12-04-2003
    Posts
    360

    Named Range - help!

    Say I have 3 sheets each with a named range on.

    I know I can use the collection to cycle thru all names...

    But how can I work out the sheet on which the name is?

    Any sort of pointer would help!

    thanks,
    Matt.

  2. #2
    Forum Contributor colofnature's Avatar
    Join Date
    05-11-2006
    Location
    -
    MS-Off Ver
    -
    Posts
    301
    To list the names of the ranges and the sheets they exist in:

    for each n in thisworkbook.names
    sheet1.cells(n.index,1).value = n.name
    sheet1.cells(n.index,2).value = mid(n.RefersTo,2,instr(n.RefersTo,"!")-2)
    next


    Col

  3. #3
    Forum Contributor
    Join Date
    12-04-2003
    Posts
    360
    cheers col - mental block on my part.

    Forgot the sheetname was in the reference!

  4. #4
    Jeff Standen
    Guest

    Re: Named Range - help!

    How about this, if you are using the names collection of the workbook:

    ?thisworkbook.Names(1).RefersToRange.Worksheet.Name

    Jeff

    "MattShoreson" <MattShoreson.28zjd1_1149605752.6187@excelforum-nospam.com>
    wrote in message
    news:MattShoreson.28zjd1_1149605752.6187@excelforum-nospam.com...
    >
    > Say I have 3 sheets each with a named range on.
    >
    > I know I can use the collection to cycle thru all names...
    >
    > But how can I work out the sheet on which the name is?
    >
    > Any sort of pointer would help!
    >
    > thanks,
    > Matt.
    >
    >
    > --
    > MattShoreson
    > ------------------------------------------------------------------------
    > MattShoreson's Profile:
    > http://www.excelforum.com/member.php...fo&userid=3472
    > View this thread: http://www.excelforum.com/showthread...hreadid=548988
    >




  5. #5
    Ardus Petus
    Guest

    Re: Named Range - help!

    Dim ws as Worksheet
    set ws = Range(myName").Worksheet

    HTH
    --
    AP

    "MattShoreson" <MattShoreson.28zjd1_1149605752.6187@excelforum-nospam.com> a
    écrit dans le message de news:
    MattShoreson.28zjd1_1149605752.6187@...rum-nospam.com...
    >
    > Say I have 3 sheets each with a named range on.
    >
    > I know I can use the collection to cycle thru all names...
    >
    > But how can I work out the sheet on which the name is?
    >
    > Any sort of pointer would help!
    >
    > thanks,
    > Matt.
    >
    >
    > --
    > MattShoreson
    > ------------------------------------------------------------------------
    > MattShoreson's Profile:
    > http://www.excelforum.com/member.php...fo&userid=3472
    > View this thread: http://www.excelforum.com/showthread...hreadid=548988
    >




+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1