+ Reply to Thread
Results 1 to 3 of 3

Delete Blank Rows Within a Range using Macro

  1. #1
    Forum Contributor
    Join Date
    04-21-2009
    Location
    USA
    MS-Off Ver
    2007
    Posts
    101

    Delete Blank Rows Within a Range using Macro

    I would like to delete all rows in my spreadsheet that doesn't contain any data within the range of B2 through E25. The below Macro almost works but doesn't remove anything past the last cell containing data within that range.

    Please Login or Register  to view this content.
    So for example, in the below image I would want rows 2,3,5,6,7,9 and 10 deleted. Since rows 4, 8 and 11 contain data within the specified range, I want to retain those rows. To clarify, I want the entire row to be deleted (no row shifting).

    nxE0ygd.png

  2. #2
    Forum Expert KOKOSEK's Avatar
    Join Date
    08-03-2018
    Location
    Pole in Yorkshire, UK
    MS-Off Ver
    365/2013
    Posts
    2,767

    Re: Delete Blank Rows Within a Range using Macro

    You want to check rows 2 to 25 (B2:E25). Code vba checks rows from 10 to 1.
    Happy with my answer * Add Reputation.
    If You are happy with solution, please use Thread tools and mark thread as SOLVED.

  3. #3
    Forum Contributor
    Join Date
    04-21-2009
    Location
    USA
    MS-Off Ver
    2007
    Posts
    101

    Re: Delete Blank Rows Within a Range using Macro

    Thank you. Replacing 10 with 25 was the trick.

+ 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] Need to delete blank rows from start range to next blank row
    By maym in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 05-12-2018, 10:24 PM
  2. Vba delete blank rows within range
    By vio.coman in forum Excel Programming / VBA / Macros
    Replies: 15
    Last Post: 06-24-2014, 01:57 PM
  3. Macro to delete blank rows if column I is blank for the row
    By tiger10012 in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 09-10-2013, 03:01 PM
  4. Delete Blank Rows in A Specified Range
    By Jack Wood in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 12-18-2012, 12:40 PM
  5. Excel 2003 - Macro to Find Page Range and Delete All Blank Rows
    By AnneL in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 04-25-2011, 04:50 PM
  6. Delete Blank Rows-Blank Row between my data range
    By Bob@Sun in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 02-27-2010, 02:52 PM
  7. [SOLVED] Can I create a macro to identify and delete blank rows in a range?
    By carlsondj in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 06-09-2005, 08:05 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