+ Reply to Thread
Results 1 to 4 of 4

Named ranges-How would I write the code for that?

  1. #1
    Steve C
    Guest

    Named ranges-How would I write the code for that?

    I have text in cell A1. In B1, I want to create a named range = text in A1.
    How would I write the code for that? Thanks.

    Steve C

  2. #2
    Vasant Nanavati
    Guest

    re: Named ranges-How would I write the code for that?

    Range("B1").Name = Range("A1")

    --

    Vasant

    "Steve C" <[email protected]> wrote in message
    news:[email protected]...
    > I have text in cell A1. In B1, I want to create a named range = text in

    A1.
    > How would I write the code for that? Thanks.
    >
    > Steve C




  3. #3
    Nick Hodge
    Guest

    re: Named ranges-How would I write the code for that?

    Steve

    Try something like this

    Sub SetRngName()
    ThisWorkbook.Names.Add Name:=Range("A1").Value, _
    RefersTo:="=Sheet1!$B$1"
    End Sub

    --
    HTH
    Nick Hodge
    Microsoft MVP - Excel
    Southampton, England
    [email protected]HIS

    "Steve C" <[email protected]> wrote in message
    news:[email protected]...
    >I have text in cell A1. In B1, I want to create a named range = text in
    >A1.
    > How would I write the code for that? Thanks.
    >
    > Steve C




  4. #4
    Steve C
    Guest

    re: Named ranges-How would I write the code for that?

    Thanks! That works great!

    "Vasant Nanavati" wrote:

    > Range("B1").Name = Range("A1")
    >
    > --
    >
    > Vasant
    >
    > "Steve C" <[email protected]> wrote in message
    > news:[email protected]...
    > > I have text in cell A1. In B1, I want to create a named range = text in

    > A1.
    > > How would I write the code for that? Thanks.
    > >
    > > Steve C

    >
    >
    >


+ 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