+ Reply to Thread
Results 1 to 5 of 5

Delete rows between two range

  1. #1
    Forum Contributor
    Join Date
    07-14-2019
    Location
    Dubai
    MS-Off Ver
    2019
    Posts
    919

    Delete rows between two range

    Hello

    Looking for VBA code to delete entire rows for the rows between Table1 and named range "Del"
    Attached Files Attached Files
    Last edited by Undo; 08-07-2022 at 08:48 AM.

  2. #2
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2404 Win 11 Home 64 Bit
    Posts
    23,852

    Re: Delete rows between two range

    cannot locate range "Del" Need a better explanation and example.
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

  3. #3
    Forum Expert
    Join Date
    07-20-2011
    Location
    Mysore, India.
    MS-Off Ver
    Excel 2019
    Posts
    8,577

    Re: Delete rows between two range

    Try this code.
    Please Login or Register  to view this content.
    NOTE: This will change the "Del" range depending on how many rows are deleted.
    Last edited by kvsrinivasamurthy; 08-07-2022 at 09:32 AM.
    Pl note
    Array formula should be confirmed with Ctrl+Shift+Enter keys together.
    If answere is satisfactory press * to add reputation.

  4. #4
    Forum Contributor
    Join Date
    07-14-2019
    Location
    Dubai
    MS-Off Ver
    2019
    Posts
    919

    Re: Delete rows between two range

    While runing the code and there is no rows between the table and named range, named range will be deleted
    maybe if we select the named range and offset -1 row, then if selected range is in table1 range then exit sub, else delete entire row, and loop until u get in table1 range
    I think this may work

    your code also work, but will face problem if there no rows between the two ranges

  5. #5
    Forum Expert
    Join Date
    07-20-2011
    Location
    Mysore, India.
    MS-Off Ver
    Excel 2019
    Posts
    8,577

    Re: Delete rows between two range

    Revised code:
    Please Login or Register  to view this content.

+ 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] Delete rows using Range and xlCellTypeConstants
    By webwyzard in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-10-2018, 10:56 AM
  2. Select a range of rows to delete
    By Dummy99 in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 03-29-2018, 12:12 AM
  3. Rows delete formula as per range of cell values with counter to delete # rows
    By qureshi2016 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 12-03-2017, 09:35 AM
  4. Delete range of rows
    By cindywylie in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 04-03-2014, 11:10 AM
  5. Delete range not rows
    By suny100 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 05-26-2011, 01:18 PM
  6. [SOLVED] Delete range if too few rows
    By beng404 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-25-2011, 09:28 AM
  7. Delete a range of rows ?
    By SpookiePower in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 01-24-2006, 11:25 AM

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