PC Review


Reply
Thread Tools Rate Thread

delete entire row if cell value in colum = 0

 
 
amanda
Guest
Posts: n/a
 
      14th Jan 2008
Hello,

I'm trying to deleta a row if the cell value in column D is zero.

Thanks!
 
Reply With Quote
 
 
 
 
Rick Rothstein \(MVP - VB\)
Guest
Posts: n/a
 
      14th Jan 2008
Something like this maybe...

Sub RemoveZeroRowsFromColumnD()
Dim X As Long
For X = ActiveSheet.Cells(Rows.Count, "D").End(xlUp).Row To 1 Step -1
If ActiveSheet.Cells(X, "D").Value = 0 Then
ActiveSheet.Cells(X, "D").EntireRow.Delete
End If
Next
End Sub

You can change the ActiveSheet reference to a specific sheet reference if
that is your need.

Rick


"amanda" <(E-Mail Removed)> wrote in message
news:84f90c40-24d5-43f5-8960-(E-Mail Removed)...
> Hello,
>
> I'm trying to deleta a row if the cell value in column D is zero.
>
> Thanks!


 
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
Specify a row based on data from a cell to delete entire row..... Fadedmartinikiss Microsoft Excel Misc 0 11th Mar 2009 08:39 PM
if a cell equal to zero how can it delete entire row =?Utf-8?B?eWVoaWE=?= Microsoft Excel Programming 1 17th Jun 2007 12:05 PM
Pulling entire colum from one cell =?Utf-8?B?YmtfNDEy?= Microsoft Excel Programming 0 21st Nov 2006 10:24 PM
Copy form on cell or Colum to another colum =?Utf-8?B?TXIgSm9obnNvbg==?= Microsoft Access Forms 3 5th May 2006 08:45 PM
formula for entire colum sigfreund Microsoft Excel Misc 1 3rd Mar 2006 07:45 PM


Features
 

Advertising
 

Newsgroups
 


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