PC Review


Reply
Thread Tools Rate Thread

delete rows where value in Column B=0

 
 
sek0910
Guest
Posts: n/a
 
      8th Feb 2008
I have a worksheet with 2 columns and 21585 rows.
I want to delete all of the rows where there is a value of "0" in column B.
Any suggestions?

Thanks,
Steve
 
Reply With Quote
 
 
 
 
sek0910
Guest
Posts: n/a
 
      8th Feb 2008
NEVER MIND, I FIGURED IT OUT

I just filtered for "0", selected all the rows, then deleted them.
 
Reply With Quote
 
Mike H
Guest
Posts: n/a
 
      8th Feb 2008
Maybe

Sub Macro2()
lastrow = Cells(Rows.Count, "B").End(xlUp).Row
For x = lastrow To 1 Step -1
If IsNumeric(Cells(x, 2).Value) And Cells(x, 2).Value = 0 Then
Rows(x).EntireRow.Delete
End If
Next
End Sub

Mike

"sek0910" wrote:

> I have a worksheet with 2 columns and 21585 rows.
> I want to delete all of the rows where there is a value of "0" in column B.
> Any suggestions?
>
> Thanks,
> Steve

 
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 if any cell in Column H is blank but do not Delete Fir =?Utf-8?B?bWFuZmFyZWVk?= Microsoft Excel Programming 4 28th Sep 2007 05:20 PM
How to Delete rows in a column =?Utf-8?B?QUxBVEw=?= Microsoft Excel Programming 2 29th Nov 2006 04:11 PM
Delete Rows Where Value in Column V is Less than 2.5? =?Utf-8?B?U3RldmVD?= Microsoft Excel Programming 1 1st Feb 2006 09:18 PM
Delete rows with nothing in Column B marlea Microsoft Excel Programming 3 31st Jan 2006 03:39 PM
Delete All Rows That Column A value is not in Column A of Sheet2 paxdak@yahoo.com Microsoft Excel Programming 2 3rd Sep 2004 09:13 PM


Features
 

Advertising
 

Newsgroups
 


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