+ Reply to Thread
Results 1 to 3 of 3

Dynamic Range Naming for VBA

  1. #1

    Dynamic Range Naming for VBA

    I've searched through the many threads that deal with naming ranges but have
    not
    come a solution to my problem, thanks for your patience with another VBA
    newbie.

    In the code below, I correctly select the range which I would like to name
    "MyRange"
    What must I add to the code to name this selected range?

    Worksheets("TempSheet").Range("A2:A" & Sheets.Count - 4).Select

    Thanks for your help.

  2. #2
    Alan Beban
    Guest

    Re: Dynamic Range Naming for VBA

    [email protected] wrote:
    > I've searched through the many threads that deal with naming ranges but have
    > not
    > come a solution to my problem, thanks for your patience with another VBA
    > newbie.
    >
    > In the code below, I correctly select the range which I would like to name
    > "MyRange"
    > What must I add to the code to name this selected range?
    >
    > Worksheets("TempSheet").Range("A2:A" & Sheets.Count - 4).Select
    >
    > Thanks for your help.


    Don't select it. Name it with

    Worksheets("TempSheet").Range("A2:A" & Sheets.Count - 4).Name = "MyRange"

    Watch for word wrap

    Alan Beban

  3. #3

    Re: Dynamic Range Naming for VBA

    Thanks Alan, I was really trying to complicate things unnecessarily.

+ 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