+ Reply to Thread
Results 1 to 2 of 2

Delete Row Macro stops at blank cell

  1. #1
    Registered User
    Join Date
    10-10-2013
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    1

    Delete Row Macro stops at blank cell

    Hello Experts,

    Please see the below code and advise why it would stop at a blank cell and not delete the entire row. Works as it should up until it encouters a blank cell, then stops.

    Appreciate any and all advice in advance!

    Sub DeleteRow()

    Set currentcell = Range("n2")
    Do While Not IsEmpty(currentcell)
    Set nextcell = currentcell.Offset(1, 0)
    If Not currentcell.Value Like "Performance*" Then
    currentcell.EntireRow.Delete
    End If
    Set currentcell = nextcell
    Loop


    End Sub

  2. #2
    Forum Expert
    Join Date
    10-10-2008
    Location
    Northeast Pennsylvania, USA
    MS-Off Ver
    Excel 2007
    Posts
    2,387

    Re: Delete Row Macro stops at blank cell

    ARLHigbee,

    Welcome to the Excel Forum.


    When we insert or delete rows we usually start from the bottom up.


    Please TEST this FIRST in a COPY of your workbook (always make a backup copy before trying new code, you never know what you might lose).

    Please Login or Register  to view this content.
    Before you use the macro with Excel 2007 or newer, save your workbook, Save As, a macro enabled workbook with the file extension .xlsm

    Then run the DeleteRowV2 macro
    Have a great day,
    Stan

    Windows 10, Excel 2007, on a PC.

    If you are satisfied with the solution(s) provided, please mark your thread as Solved by clicking EDIT in your original post, click GO ADVANCED and set the PREFIX box to SOLVED.

+ 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. 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
  2. [SOLVED] Macro Loops through 10 rows, find's next cell value > 0 places X in adjacent cell & Stops.
    By MIACG in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-10-2013, 03:30 PM
  3. Macro to delete rows if a cell in the row above is blank
    By mrsvanessen in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-07-2013, 10:03 AM
  4. Macro: delete row any time column A is blank cell ?
    By Mr. Humble in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-12-2008, 02:44 PM
  5. Every 4th cell is blank and stops my macro!
    By Sandeman in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 03-17-2006, 12:10 PM

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