Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Delete Row Macro

Hello
I have a sheet of approx 200 rows that is updated monthly from MS Money.
Could anybody advise a macro to delete rows with a specific cell value of
zero? ie if E*=0,delete row
Thanks very much
Doug


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 74
Default Delete Row Macro

Doug,

Sub deleterowswithblankcells()
Dim cell As Range

Sheets("sheet1").Activate 'replace sheet1 with your sheet name
For Each cell In ActiveSheet.Range("A1:E20") 'replace A1:E20 with
your range
If cell.Value = 0 Then
ActiveSheet.Rows(cell.Row).Delete (xlUp)
End If
Next
End Sub

This should work.If you just want to delete rows with a value of 0 in
column E then change the range to E1:E1000 or whatever.

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
Macro to delete sheets and saves remaining file does not properly delete module pherrero Excel Programming 1 June 22nd 05 01:12 AM
Macro to delete sheets and saves remaining file does not properly delete module pherrero Excel Programming 0 June 21st 05 05:16 PM
Macro to delete sheets and saves remaining file does not properly delete module bhawane Excel Programming 0 June 21st 05 04:53 PM
Macro to delete sheets and saves remaining file does not properly delete module bhawane Excel Programming 0 June 21st 05 04:53 PM
Macro to delete sheets and saves remaining file does not properly delete module bhawane Excel Programming 0 June 21st 05 04:20 PM


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

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"