+ Reply to Thread
Results 1 to 6 of 6

Macro to delete rows below based on cell value

Hybrid View

  1. #1
    Forum Contributor
    Join Date
    11-04-2012
    Location
    Czech Republic
    MS-Off Ver
    MS 365
    Posts
    267

    Macro to delete rows below based on cell value

    Hi all

    Hope that here is someone who could help me with a following macro.

    Is there a way to delet always 10 rows below if cell A2, B2 and C2 are empty, than if A12, B12 and C12 are empty, than A22, B22 and C22 etc and continze to the last row?

    Thank youuuuu 😊
    Andy

  2. #2
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: Macro to delete rows below based on cell value

    Maybe:

    Sub dobracik()
    Dim i As Long
    For i = Range("A" & Rows.Count).End(3).Row To 2 Step -1
        If Cells(i, "A") = "" And Cells(i, "B") = "" And Cells(i, "C") = "" Then
            Cells(i, "A").Offset(1).Resize(10).EntireRow.Delete
        End If
    Next i
    End Sub

  3. #3
    Forum Contributor
    Join Date
    11-04-2012
    Location
    Czech Republic
    MS-Off Ver
    MS 365
    Posts
    267

    Re: Macro to delete rows below based on cell value

    Hi John,

    thanks for your reply. However is deleting everything :-( I was trying to update this macro, but not succesfuly. It always delete all the rows except first 3.
    I'm attaching example for better picture,

    Thanks a lot
    Andy
    Attached Files Attached Files

  4. #4
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: Macro to delete rows below based on cell value

    Try:

    Sub dobracik()
    Dim i As Long
    For i = Range("A" & Rows.Count).End(3).Row To 2 Step -10
        If Cells(i, "A") = "" And Cells(i, "B") = "" And Cells(i, "C") = "" Then
            Cells(i, "A").Resize(10).EntireRow.Delete
        End If
    Next i
    End Sub

  5. #5
    Forum Contributor
    Join Date
    11-04-2012
    Location
    Czech Republic
    MS-Off Ver
    MS 365
    Posts
    267

    Re: Macro to delete rows below based on cell value

    Yeyyyy, cool, warking perfect
    Thanks a lot lot!

  6. #6
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: Macro to delete rows below based on cell value

    You're welcome. Glad to help out and thanks for the feedback.

+ 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 that will delete/hide rows based on a cell value
    By dwilkinson12 in forum Excel Programming / VBA / Macros
    Replies: 15
    Last Post: 11-27-2014, 05:59 AM
  2. [SOLVED] Find rows to delete with a macro based on cell content
    By mkraffert in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 08-28-2013, 06:27 PM
  3. Macro to delete several rows based on a cell's contents
    By ppp112 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-26-2013, 01:16 PM
  4. Macro to delete rows based on a value in cell
    By vjboaz in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-22-2008, 01:28 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