+ Reply to Thread
Results 1 to 3 of 3

code to add a name to the names collection and assign a reference

  1. #1
    keithb
    Guest

    code to add a name to the names collection and assign a reference

    Can someone give me an example showing code to add a name to the names
    collection and to assign the name to a range reference such as,
    "mynamesfile.xls!customername"

    Thanks,

    Keith



  2. #2
    Norman Jones
    Guest

    Re: code to add a name to the names collection and assign a reference

    Hi Keith,

    I though that I had - in response to you other posts in the Excel group.

    ---
    Regards,
    Norman



    "keithb" <[email protected]> wrote in message
    news:[email protected]...
    > Can someone give me an example showing code to add a name to the names
    > collection and to assign the name to a range reference such as,
    > "mynamesfile.xls!customername"
    >
    > Thanks,
    >
    > Keith
    >




  3. #3
    Nigel
    Guest

    Re: code to add a name to the names collection and assign a reference

    The first instance add the name MyNameRange to range A1 to E5, if you need
    to do this under program control it might be easier to use the second
    version that specifies the row and column numbers (also range A1 to
    E5)....., prefix the Range with Worksheets("MySheet") if it is not on the
    active sheet.


    ActiveWorkbook.Names.Add Name:="MyNameRange", _
    RefersTo:=Range("A1:E5")


    ActiveWorkbook.Names.Add Name:="MyNameRange", _
    RefersTo:=Range(Cells(1, 5), Cells(5, 5))

    --
    Cheers
    Nigel



    "keithb" <[email protected]> wrote in message
    news:[email protected]...
    > Can someone give me an example showing code to add a name to the names
    > collection and to assign the name to a range reference such as,
    > "mynamesfile.xls!customername"
    >
    > Thanks,
    >
    > Keith
    >
    >




+ 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