+ Reply to Thread
Results 1 to 4 of 4

Find the last row without data in columns E and F and delete the 10 rows below them

Hybrid View

duugg Find the first row without... 03-14-2008, 10:45 AM
Caligula Hi, There aren't Excel... 03-17-2008, 01:40 AM
duugg I will try that the first... 03-18-2008, 09:58 AM
duugg Re: Find the last row without... 03-19-2009, 09:11 AM
  1. #1
    Valued Forum Contributor
    Join Date
    04-11-2006
    MS-Off Ver
    2007
    Posts
    438

    Find the first row without data in columns E and F and delete the 10 rows below them

    Hi,

    I'm trying to come up with a formula to find the last row without any data in columns E and F and delete the 10 rows below them.

    Is there a way to do this?

    Thanks in advance
    Last edited by Andy Pope; 03-19-2009 at 09:20 AM. Reason: Meant to say first row

  2. #2
    Registered User
    Join Date
    05-28-2005
    Location
    WI, USA
    MS-Off Ver
    Office XP/2003
    Posts
    95
    Hi,

    There aren't Excel formulas that will delete rows (that I know of), but you can do this via a macro. Here's the code for a routine
    Private Sub DeleteRows()
    Dim lRow As Long
    Set e = Range("e:e").Find("*", searchdirection:=xlPrevious)
    Set f = Range("f:f").Find("*", searchdirection:=xlPrevious)
    
        If e.Row > f.Row Then
        lRow = e.Row + 1
        Else: lRow = f.Row + 1
        End If
    
    Rows(lRow & ":" & lRow + 9).Delete
    
    End Sub
    It looks for the last row that has data in either column e or f, then deletes the ten rows below that. Let me know if you have any questions.

    -Chris

  3. #3
    Valued Forum Contributor
    Join Date
    04-11-2006
    MS-Off Ver
    2007
    Posts
    438
    I will try that the first chance I get.

    Thanks much!

    duugg

  4. #4
    Valued Forum Contributor
    Join Date
    04-11-2006
    MS-Off Ver
    2007
    Posts
    438

    Re: Find the last row without data in columns E and F and delete the 10 rows below th

    A little late in trying, but it indeed worked!

    Thanks much

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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