+ Reply to Thread
Results 1 to 3 of 3

refer to range within named range

  1. #1
    Forum Contributor
    Join Date
    07-13-2017
    Location
    Hong Kong
    MS-Off Ver
    MS Office 365
    Posts
    481

    refer to range within named range

    Hi all,

    Can I refer to a range within a named range? My named range looks something like this:

    Please Login or Register  to view this content.
    Now I only want to refer to the second part within that range, which would be Range("F1:H1"). How can I do that within VBA?

  2. #2
    Forum Expert rorya's Avatar
    Join Date
    08-13-2008
    Location
    East Sussex, UK
    MS-Off Ver
    365 Ent Monthly Channel / Insiders Beta
    Posts
    8,908

    Re: refer to range within named range

    Do you mean that you have a named range that refers to Range("A1:C1,F1:H1,M1:O1"), or are you calling that a named range?

    Assuming you have assigned the range to a variable called rg, you can use rg.Areas(2) to refer to the second area.

  3. #3
    Forum Contributor
    Join Date
    07-13-2017
    Location
    Hong Kong
    MS-Off Ver
    MS Office 365
    Posts
    481

    Re: refer to range within named range

    Please Login or Register  to view this content.
    worked well for me! Needed this for the unhiding columns code in my other thread! Thanks!!

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Refer to name of named range - name manager
    By jaryszek in forum Excel General
    Replies: 16
    Last Post: 05-15-2018, 08:15 AM
  2. Refer dynamically to a table named range in VBA
    By freelensia in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-02-2017, 02:31 AM
  3. [SOLVED] What happens when I refer to a named range?
    By RogeratCCCC in forum Excel - New Users/Basics
    Replies: 4
    Last Post: 04-21-2012, 04:06 PM
  4. VBA Refer to named range in different workbook
    By globalpontoon in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 08-07-2010, 03:20 AM
  5. Refer to named range in another file
    By Bob@Sun in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 05-04-2010, 01:22 PM
  6. Refer indirectly to named range
    By chartguy in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 05-16-2009, 12:50 PM
  7. [SOLVED] How does one refer to the n-1 element of a named range?
    By Charles Hewitt in forum Excel General
    Replies: 2
    Last Post: 11-26-2005, 03:00 AM

Tags for this Thread

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