View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Frank Kabel Frank Kabel is offline
external usenet poster
 
Posts: 3,885
Default deleting rows with zero value

Hi
don't understand the second part of your question (saved blabk) But for
the first part try the following macro (put this in your workbook
module:
Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As
Boolean)
Dim RowNdx As Long
Dim LastRow As Long
Application.ScreenUpdating = False
LastRow = ActiveSheet.Cells(Rows.Count, "C").End(xlUp).row
For RowNdx = LastRow To 1 Step -1
if cells(RowNdx,"C").value = 0 then
Rows(RowNdx).Delete
end if
Next RowNdx
Application.ScreenUpdating = True
End Sub

--
Regards
Frank Kabel
Frankfurt, Germany


Hello, I've an xl file (XL2K-XP) which is an accounting file 3
worsheets. The sheet "Recap" have 5 colums i.e A.col=accounting items
- B.col=details - C.col=amounts in US$ - D.col.=amounts in foreign
currencies - E.col.=amounts details
About 250 accounting items are listed in col.A
This file is filled by various partners with their specifics items,
that means that some items have no value (Zero by default).
What I want is when saving the file, all the rows with zero value in
C.col are deleted BUT a problem should arise when the file is saved
"blank" before filling it, all the rows will be deleted.

How this could be managed ?


---
Message posted from http://www.ExcelForum.com/