View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Bernie Deitrick Bernie Deitrick is offline
external usenet poster
 
Posts: 5,441
Default Can I print only specified pages from a print range such as pages 1,3,4,6

Mel,

Worksheets("Name").PrintOut From:=1, To:=1
Worksheets("Name").PrintOut From:=3, To:=3
Worksheets("Name").PrintOut From:=4, To:=4
Worksheets("Name").PrintOut From:=6, To:=6

Obviously, you would want to add logic and looping, along the lines of

For i = 1 To 6
If SomeCondition = True Then
Worksheets("Name").PrintOut From:=i, To:=i
End If
Next i

HTH,
Bernie
MS Excel MVP


"Mel" wrote in message
...
Is there a way to print only part of the pages in a print
range. For instance I want to print the travel page for
task2 only if there are travel costs. I know how to check
the value of the travel costs, but is there a way to
leave this sheet out if there are no costs. I'm wondering
if there is a way to get the range reference for each
page and then print only the ones I want. Any suggestions
would be appreciated.
Thanks