#1   Report Post  
JIM.H.
 
Posts: n/a
Default Q: delete rows

Hello,

I have an excel file and I want to write a macro that delete all the rows
if D,E,F columns have zero values.
Can anyone give me a code for this?
Thanks,

  #2   Report Post  
David Hepner
 
Posts: n/a
Default

This code is designed to delete the row if the columns D,E and F have a 0
value (not a blank).


Sub Macro1()
Dim i As Long
Dim c As Integer
c = 0
Application.ScreenUpdating = False

For i = 1 To 65536
If Range("D" & i).Value = c And Range("E" & i).Value = c And Range("F" &
i).Value = c Then
Rows(i & ":" & i).Select
Selection.Delete Shift:=xlUp
End If

Next i

Application.ScreenUpdating = True

End Sub






"JIM.H." wrote:

Hello,

I have an excel file and I want to write a macro that delete all the rows
if D,E,F columns have zero values.
Can anyone give me a code for this?
Thanks,

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
How can we delete rows permanently from excel sheet Nehal Shah Excel Discussion (Misc queries) 1 August 1st 05 01:58 PM
In a protected worksheet allow users to delete rows Jason Trivett Excel Worksheet Functions 1 July 12th 05 09:50 AM
How do I find duplicate rows in a list in Excel, and not delete it Matthew in FL Excel Discussion (Misc queries) 2 June 15th 05 09:11 PM
Protect Worksheet but allow to insert or delete rows Bob L Hilliard Excel Discussion (Misc queries) 2 June 9th 05 02:08 PM
How to delete blank rows John Mansfield Excel Discussion (Misc queries) 3 April 27th 05 11:48 PM


All times are GMT +1. The time now is 05:31 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"