我们正在寻找一个宏,如果列I的值为零,用户点击打印按钮后将删除整行。它删除了一切。 http://i.imgur.com/1SVDVLi.jpg
Private Sub Workbook_BeforePrint(Cancel As Boolean)
Sub DeleteRows()
Dim c As Range
Dim SrchRng
Set SrchRng = ActiveSheet.UsedRange
Do
Set c = SrchRng.Find("0", LookIn:=xlValues)
If Not c Is Nothing Then c.EntireRow.Delete
Loop While Not c Is Nothing
End Sub