print from macro, using if formula
I have tried both of your suggestions and with both, the print will be
performed even when the value is 0.
--
hog1
"mikelee101" wrote:
You might try either of these and see what you think:
======
Dim CollVar as Boolean
If Thisworkbook.Worksheets("Title").Range("D9").Value 0 then
CollVar = True
else
CollVar = False
End if
ActiveWindow.SelectedSheets.PrintOut Copies:=1, ActivePrinter:= _
"EPSON Stylus C88 Series on Ne03:", Collate:=CollVar
Or===
If Thisworkbook.Worksheets("Title").Range("D9").Value 0 then
ActiveWindow.SelectedSheets.PrintOut Copies:=1, ActivePrinter:= _
"EPSON Stylus C88 Series on Ne03:", Collate:=True
Else
ActiveWindow.SelectedSheets.PrintOut Copies:=1, ActivePrinter:= _
"EPSON Stylus C88 Series on Ne03:", Collate:=False
End if
=====
Hope that helps.
--
Mike Lee
McKinney,TX USA
"Hog1" wrote:
I currently use a macro to print several sheets from one workbook. I would
like the option to print some of the sheets with the condition of the value
of a cell in the first sheet being 0. My current Macro looks like this,
ActiveWindow.SelectedSheets.PrintOut Copies:=1, ActivePrinter:= _
"EPSON Stylus C88 Series on Ne03:", Collate:=True
I've been trying to use the following,
ActiveWindow.SelectedSheets.PrintOut Copies:=1, ActivePrinter:= _
"EPSON Stylus C88 Series on Ne03:", Collate:=IF(Title!D90,"True")
and
ActiveWindow.SelectedSheets.PrintOut Copies:=1, ActivePrinter:= _
"EPSON Stylus C88 Series on Ne03:", Collate:=(IF(Title!D90,"True"))
Any help is greatly appreciated.
--
hog1
|