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
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
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 routineIt 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.![]()
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
-Chris
I will try that the first chance I get.
Thanks much!
duugg
A little late in trying, but it indeed worked!
Thanks much
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks