Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default if a cell equal to zero how can it delete entire row

if a cell equal to zero how can we formulate it to delete the entire row
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,058
Default if a cell equal to zero how can it delete entire row

For only a single cell, say cell Z100:


Sub demo()
If Range("Z100").Value = 0 Then
Range("Z100").EntireRow.Delete
End If
End Sub


For a range of cells, say all the cells in column Z

Sub demoi()
n = Cells(Rows.Count, "Z").End(xlUp).Row
For i = n To 1 Step -1
If Cells(i, "Z").Value = 0 Then
Cells(i, "Z").EntireRow.Delete
End If
Next
End Sub

--
Gary''s Student - gsnu200730


"yehia" wrote:

if a cell equal to zero how can we formulate it to delete the entire row

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
Specify a row based on data from a cell to delete entire row..... Fadedmartinikiss Excel Discussion (Misc queries) 0 March 11th 09 08:39 PM
Delete entire row based on cell color CMcK Excel Programming 3 October 27th 06 02:00 PM
can I delete entire row if adjacent cell formats differ? ksukid Excel Worksheet Functions 0 May 19th 05 09:28 PM
macro to find date format in a cell and delete that entire row vikram Excel Programming 8 April 30th 04 06:00 PM
Delete entire row based on cell content PHIL Excel Programming 2 December 3rd 03 01:39 AM


All times are GMT +1. The time now is 11:48 AM.

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"