PC Review


Reply
Thread Tools Rate Thread

Deleting Rows Macro

 
 
Workbook
Guest
Posts: n/a
 
      20th Feb 2009
I'd like to create a macro that will search every row in columns A:L. Every
time columns I:L do not have contents inside of it, I would like the entire
row A:L to be deleted.
 
Reply With Quote
 
 
 
 
Per Jessen
Guest
Posts: n/a
 
      20th Feb 2009
Sub DeleteRows()

FirstRow = 2
LastRow = Range("A" & Rows.Count).End(xlUp).Row
For r = LastRow To FirstRow Step -1
If WorksheetFunction.CountBlank(Range("I" & r & ":L" & r)) = 4 Then
Rows(r).Delete
End If
Next
End Sub

Hopes this helps.

---
Per

"Workbook" <(E-Mail Removed)> skrev i meddelelsen
news:C511706D-92AC-4660-B43C-(E-Mail Removed)...
> I'd like to create a macro that will search every row in columns A:L.
> Every
> time columns I:L do not have contents inside of it, I would like the
> entire
> row A:L to be deleted.


 
Reply With Quote
 
Workbook
Guest
Posts: n/a
 
      24th Mar 2009
Works like a charm! Thank you for you're help

"Per Jessen" wrote:

> Sub DeleteRows()
>
> FirstRow = 2
> LastRow = Range("A" & Rows.Count).End(xlUp).Row
> For r = LastRow To FirstRow Step -1
> If WorksheetFunction.CountBlank(Range("I" & r & ":L" & r)) = 4 Then
> Rows(r).Delete
> End If
> Next
> End Sub
>
> Hopes this helps.
>
> ---
> Per
>
> "Workbook" <(E-Mail Removed)> skrev i meddelelsen
> news:C511706D-92AC-4660-B43C-(E-Mail Removed)...
> > I'd like to create a macro that will search every row in columns A:L.
> > Every
> > time columns I:L do not have contents inside of it, I would like the
> > entire
> > row A:L to be deleted.

>
>

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Macro for deleting rows and serialising the remaing rows Srinivasulu Bhattaram Microsoft Excel Programming 2 13th Nov 2008 01:32 PM
Macro for deleting rows and serialising the remaing rows Srinivasulu Bhattaram Microsoft Excel Setup 1 12th Nov 2008 06:05 PM
Macro for deleting rows and serialising the remaing rows Srinivasulu Bhattaram Microsoft Excel Worksheet Functions 1 12th Nov 2008 01:39 PM
Macro for deleting rows and serialising the remaing rows Srinivasulu Bhattaram Microsoft Excel Discussion 1 12th Nov 2008 01:32 PM
Macro deleting specified rows Snoopy Microsoft Excel Charting 0 15th Feb 2006 12:56 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 07:28 PM.