Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default How can I delete rows programmatically based on certain criteria?

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?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,058
Default How can I delete rows programmatically based on certain criteria?

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
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Delete Rows based on criteria in excel Novaglory Excel Discussion (Misc queries) 5 July 10th 07 08:29 PM
How can I delete rows programmatically based on certain criteria? nt_artagnian[_2_] New Users to Excel 2 March 8th 07 03:56 AM
How can I delete rows programmatically based on certain criteria? nt_artagnian[_2_] Excel Worksheet Functions 1 March 7th 07 05:48 PM
Delete rows based on criteria Chris_t_2k5 Excel Discussion (Misc queries) 2 April 11th 06 01:52 PM
Delete rows based on certain criteria Coal Miner Excel Discussion (Misc queries) 2 March 3rd 06 05:56 PM


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

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"