View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Hog1 Hog1 is offline
external usenet poster
 
Posts: 3
Default 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