+ Reply to Thread
Results 1 to 4 of 4

Add previous row to named range

  1. #1
    Registered User
    Join Date
    04-05-2017
    Location
    Houston, TX
    MS-Off Ver
    2016
    Posts
    57

    Add previous row to named range

    If I have a named range, rng, that encompasses cells A30 to O35 and to add a row at the beginning (row 35) using a Macro then rng shifts down as well so that it is now A31:O36.

    How can I add a row in VBA and then expand rng to include the new row so that it is now A30:O36?

    I've been searching but so far haven't been able to get either Resize or Offset to work to accomplish this.

    Thanks in advance.

  2. #2
    Forum Expert
    Join Date
    06-09-2010
    Location
    Australia
    MS-Off Ver
    Excel 2013
    Posts
    1,714

    Re: Add previous row to named range

    Hi
    try this

    Please Login or Register  to view this content.

  3. #3
    Forum Expert
    Join Date
    11-22-2016
    Location
    Cornwall,UK
    MS-Off Ver
    office 365
    Posts
    4,240

    Re: Add previous row to named range

    I think I misread you request - these do not include inserting a row

    What you are trying explained:
    Please Login or Register  to view this content.
    Simplified:
    Please Login or Register  to view this content.
    As a single line:
    Please Login or Register  to view this content.
    Last edited by kev_; 04-12-2017 at 01:08 AM.
    Click *Add Reputation to thank those who helped you. Ask if anything is not clear

  4. #4
    Forum Expert
    Join Date
    11-22-2016
    Location
    Cornwall,UK
    MS-Off Ver
    office 365
    Posts
    4,240

    Re: Add previous row to named range

    This time includes adding a row at the top (which makes Excel push the named range down by a row)
    (With Named Range "MyNamedRange" with RefersTo = A30 to O35)

    Please Login or Register  to view this content.
    (after VBA run, NamedRange "MyNamedRange" with RefersTo = A30 to O36)
    Last edited by kev_; 04-12-2017 at 02:30 AM.

+ 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. [SOLVED] Compare cells to named range and create new sheets using related named range
    By drewship in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 12-10-2015, 03:35 PM
  2. [SOLVED] Assign named range to one cell depending on named range in another
    By x65140 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-22-2015, 11:04 AM
  3. [SOLVED] determining if cell is part of named range and what that named range is
    By stnkynts in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 08-16-2014, 07:56 PM
  4. Adding row to a named range-updating the named range address
    By kjsconv in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 08-12-2013, 11:22 PM
  5. Replies: 1
    Last Post: 02-27-2013, 12:00 AM
  6. [SOLVED] Determine what Named Range the Target Address is and return Named Range Name
    By jordan2322 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 06-18-2012, 10:49 PM
  7. Display previous month text from a named range
    By purdue7997 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-30-2009, 01:44 PM

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