PC Review


Reply
Thread Tools Rate Thread

delete row if 2 cells are empty

 
 
Wanna Learn
Guest
Posts: n/a
 
      19th Nov 2009
Hello I get a daily report and I have to delete the entire row if cell AA
and Cell AB are empty. staring from row 4 till the end. I have been doing
this manually but is there a VBA code that would make this faster. thanks
in advance
 
Reply With Quote
 
 
 
 
Don Guillett
Guest
Posts: n/a
 
      19th Nov 2009
Unless aa a/o bb populated with a space bar this should do it.

Sub delrowsifaaempty()
lr = Cells.find(What:="*", After:=[A1], _
SearchDirection:=xlPrevious).Row
For i = lr To 4 Step -1
If Cells(i, "aa") = "" And Cells(i, "ab") = "" Then Rows(i).Delete
Next i
End Sub

--
Don Guillett
Microsoft MVP Excel
SalesAid Software
(E-Mail Removed)
"Wanna Learn" <(E-Mail Removed)> wrote in message
news:EA279432-D30B-4706-80E0-(E-Mail Removed)...
> Hello I get a daily report and I have to delete the entire row if cell AA
> and Cell AB are empty. staring from row 4 till the end. I have been
> doing
> this manually but is there a VBA code that would make this faster.
> thanks
> in advance


 
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
delete cells column. Delete empty cells myshak Microsoft Excel Worksheet Functions 0 9th Mar 2009 10:59 PM
Can't delete empty but active cells Peter Chatterton Microsoft Excel Programming 8 21st May 2007 04:20 AM
Delete row if 3 columns have empty cells in a row Les Stout Microsoft Excel Programming 7 18th Apr 2007 06:30 PM
Re: Delete Empty Cells in a Macro Bob Phillips Microsoft Excel Misc 1 9th Jan 2007 04:58 PM
Delete Rows with Empty Cells with empty column 1 Scott Microsoft Excel Programming 6 2nd Oct 2006 11:57 PM


Features
 

Advertising
 

Newsgroups
 


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