PC Review


Reply
Thread Tools Rate Thread

How can I delete rows programmatically based on certain criteria?

 
 
=?Utf-8?B?bnRfYXJ0YWduaWFu?=
Guest
Posts: n/a
 
      7th Mar 2007
I have a large dataset in Microsoft Excel 2003 with almost 3000 lines and
I want to delete the rows of it, which have nulls in one or more of their
columns.
e.g.
A B C D
1 2 3 4
1 4 5
2 3 4
Result : The 2nd and 3rd rows will be deleted or someway discarded.
How can I do this?
 
Reply With Quote
 
 
 
 
=?Utf-8?B?R2FyeScncyBTdHVkZW50?=
Guest
Posts: n/a
 
      7th Mar 2007
Sub marine()
For i = 100 To 1 Step -1
If IsEmpty(Cells(i, "D")) Then
Cells(i, "D").EntireRow.Delete
End If
Next
End Sub

Adjust the 100 to meet your needs
--
Gary''s Student
gsnu200709


"nt_artagnian" wrote:

> I have a large dataset in Microsoft Excel 2003 with almost 3000 lines and
> I want to delete the rows of it, which have nulls in one or more of their
> columns.
> e.g.
> A B C D
> 1 2 3 4
> 1 4 5
> 2 3 4
> Result : The 2nd and 3rd rows will be deleted or someway discarded.
> How can I do this?

 
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 rows based on multiple criteria puiuluipui Microsoft Excel Misc 6 3rd Jul 2009 01:58 PM
How can I delete rows programmatically based on certain criteria? =?Utf-8?B?bnRfYXJ0YWduaWFu?= Microsoft Excel New Users 2 8th Mar 2007 03:56 AM
How can I delete rows programmatically based on certain criteria? =?Utf-8?B?bnRfYXJ0YWduaWFu?= Microsoft Excel Worksheet Functions 1 7th Mar 2007 05:48 PM
Delete rows based on criteria =?Utf-8?B?Q2hyaXNfdF8yazU=?= Microsoft Excel Misc 2 11th Apr 2006 01:52 PM
Delete rows based on certain criteria =?Utf-8?B?Q29hbCBNaW5lcg==?= Microsoft Excel Misc 2 3rd Mar 2006 05:56 PM


Features
 

Advertising
 

Newsgroups
 


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