+ Reply to Thread
Results 1 to 10 of 10

Shift named dynamic range down

  1. #1
    Forum Contributor
    Join Date
    04-14-2013
    Location
    Ky
    MS-Off Ver
    Excel 2013
    Posts
    344

    Shift named dynamic range down

    I have a named dynamic range in the workbook, and I'm wanting VBA to select it and shift it down one row.

    I keep trying to select the range using .Range("NamedRange") and then using shift xlDown, but it doesn't like it. I'm thinking maybe I need to name my range in the code itself rather than use .Range("NamedRange")??

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,433

    Re: Shift named dynamic range down

    A Named Range is usually there so you "know where it is" despite movements on the sheet, for example, rows and columns being inserted. A Dynamic Named Range is a variation on a theme usually depending on a count of cells to determine where the last row is.

    If you want to move a Dynamic Named Range down, you need to change the cell it uses as a start cell and adjust the counter to take into account any blank cells inserted above it.

    Regards, TMS
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  3. #3
    Forum Contributor
    Join Date
    04-14-2013
    Location
    Ky
    MS-Off Ver
    Excel 2013
    Posts
    344

    Re: Shift named dynamic range down

    So this is my current code (in a user form), which it doesn't like

    Please Login or Register  to view this content.

  4. #4
    Forum Expert
    Join Date
    02-11-2014
    Location
    New York
    MS-Off Ver
    Excel 365 (Windows)
    Posts
    5,945

    Re: Shift named dynamic range down

    Maybe?

    Please Login or Register  to view this content.
    Last edited by Bernie Deitrick; 04-16-2015 at 02:40 PM.
    Bernie Deitrick
    Excel MVP 2000-2010

  5. #5
    Forum Contributor
    Join Date
    04-14-2013
    Location
    Ky
    MS-Off Ver
    Excel 2013
    Posts
    344

    Re: Shift named dynamic range down

    I thought your first post with:
    Please Login or Register  to view this content.
    was getting closer ...

    The problem I see with your edited solution is I really don't want to insert a new row. My range is:

    Formula: copy to clipboard
    Please Login or Register  to view this content.


    which covers A:H beginning in row 7 and on down, but I have d other data in columns J- W that aren't a part of this range/function.

  6. #6
    Forum Expert
    Join Date
    02-11-2014
    Location
    New York
    MS-Off Ver
    Excel 365 (Windows)
    Posts
    5,945

    Re: Shift named dynamic range down

    I think, maybe:

    Please Login or Register  to view this content.

  7. #7
    Forum Contributor
    Join Date
    04-14-2013
    Location
    Ky
    MS-Off Ver
    Excel 2013
    Posts
    344

    Re: Shift named dynamic range down

    Definitely getting closer!

    It's putting in rows where it shouldn't though... I tried changing the .Rows(2) to (1) and even (0) with no luck...Sample 1.xlsx.xlsm

  8. #8
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,433

    Re: Shift named dynamic range down

    Is this what you are looking for:

    Please Login or Register  to view this content.

    Regards, TMS

  9. #9
    Forum Expert
    Join Date
    02-11-2014
    Location
    New York
    MS-Off Ver
    Excel 365 (Windows)
    Posts
    5,945

    Re: Shift named dynamic range down

    Change your name definition for CoverageList to this, to withstand insertions:

    =OFFSET(INDIRECT("Coverage!$A$7"),0,0,COUNTA(Coverage!$A:$A),8)

    And use this code

    Please Login or Register  to view this content.

  10. #10
    Forum Contributor
    Join Date
    04-14-2013
    Location
    Ky
    MS-Off Ver
    Excel 2013
    Posts
    344

    Re: Shift named dynamic range down

    Perfect! Thank you!!

+ 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] dynamic named range not populating combo box list if range = single cell
    By HeyInKy in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 10-24-2014, 05:27 PM
  2. Dynamic / Named Print Range To Include Another Range of Cells
    By thekrakenwakes in forum Excel General
    Replies: 0
    Last Post: 07-25-2014, 07:52 AM
  3. [SOLVED] creating a named range taking the avg. to date of a dynamic range.
    By siggisigg in forum Excel General
    Replies: 1
    Last Post: 07-15-2014, 08:58 AM
  4. [SOLVED] Dynamic Named Range to Auto-Populate another range based on criteria
    By BeachRock in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 03-24-2014, 06:46 PM
  5. Named ranges-Should I use a dynamic named range
    By foseco in forum Excel General
    Replies: 4
    Last Post: 06-11-2009, 03:56 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