Thread
:
conditional disable functions
View Single Post
#
2
Posted to microsoft.public.excel.programming
Tom Ogilvy
external usenet poster
Posts: 27,285
conditional disable functions
Private Sub Workbook_BeforePrint(Cancel As Boolean)
suppres_lines
if <condition then
Cancel = True
end if
End Sub
--
Regards,
Tom Ogilvy
"Andre S" <Andre
wrote in message
...
Hi all,
In a worksheet, I work with data in a table and the last colomn has a sum
function. that can be a value or 0. Because all rows that ends with sum =
0,
I want to suppress them when I print. Therefore I start a macro
suppres_lines
that uses the filterfunction and all rows with value 0 are hidden. I
placed
the macro under the Workbook folder
Private Sub Workbook_BeforePrint(Cancel As Boolean)
suppres_lines
End Sub
But it can also be, that under circumstances there is no row in the table
at
all. (all rows are 0) Therefore I would have the possibilty to cancel the
printcommand. I tried a lot of things, like Exit sub, but after exiting
this
BEFOREprint, the printcommand is still executed. Is there something that
cancels the action that would be taken after a before...(print/save/close)
action?
Andre S
Reply With Quote
Tom Ogilvy
View Public Profile
Find all posts by Tom Ogilvy