+ Reply to Thread
Results 1 to 3 of 3

Create Named Range in VBA

  1. #1
    Registered User
    Join Date
    03-31-2006
    Posts
    27

    Create Named Range in VBA

    I would like to highlight a range of cells in my worksheet and then run a macro that will then create a Named Range using those highlighted cells.

    I suppose the VBA would be something like:
    ThisWorkbook.Names.Add Name:="NewName", _
    RefersTo:=

    But I don't know what code is needed next. Can anyone help?

    Many Thanks,
    Michael

  2. #2
    Norman Jones
    Guest

    Re: Create Named Range in VBA

    Hi Michael,

    Try:

    '=============>>
    Public Sub Tester()
    Selection.Name = "YourName"
    End Sub
    '<<=============


    ---
    Regards,
    Norman


    "michael.a7" <[email protected]> wrote
    in message news:[email protected]...
    >
    > I would like to highlight a range of cells in my worksheet and then run
    > a macro that will then create a Named Range using those highlighted
    > cells.
    >
    > I suppose the VBA would be something like:
    > ThisWorkbook.Names.Add Name:="NewName", _
    > RefersTo:=
    >
    > But I don't know what code is needed next. Can anyone help?
    >
    > Many Thanks,
    > Michael
    >
    >
    > --
    > michael.a7
    > ------------------------------------------------------------------------
    > michael.a7's Profile:
    > http://www.excelforum.com/member.php...o&userid=33027
    > View this thread: http://www.excelforum.com/showthread...hreadid=550149
    >




  3. #3
    Registered User
    Join Date
    03-31-2006
    Posts
    27

    Create Named Range

    Thanks Norman

+ 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