Can I print only specified pages from a print range such as pages 1,3,4,6

  • Thread starter Thread starter Mel
  • Start date Start date
M

Mel

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
 
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
 
Thanks a bunch.
-----Original Message-----
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





.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top