Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default delete rows where value in Column B=0

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
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default delete rows where value in Column B=0

NEVER MIND, I FIGURED IT OUT

I just filtered for "0", selected all the rows, then deleted them.
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,501
Default delete rows where value in Column B=0

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
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 if any cell in Column H is blank but do not Delete Fir manfareed Excel Programming 4 September 28th 07 05:20 PM
How to Delete rows in a column ALATL Excel Programming 2 November 29th 06 04:11 PM
Delete Rows Where Value in Column V is Less than 2.5? SteveC Excel Programming 1 February 1st 06 09:18 PM
Delete rows with nothing in Column B marlea[_12_] Excel Programming 3 January 31st 06 03:39 PM
Delete All Rows That Column A value is not in Column A of Sheet2 [email protected] Excel Programming 2 September 3rd 04 09:13 PM


All times are GMT +1. The time now is 06:53 AM.

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

About Us

"It's about Microsoft Excel"