Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default PRINT command button

I currently print our purchase orders using a command button with code:

Private Sub CommandButton1_Click()
ActiveWindow.SelectedSheets.PrintOut From:=1, To:=2, Copies:=2, Collate _
:=True
End Sub

This works great but sometimes the PO is only one page. I don't want it to
print the 2nd page. How do I need to change this?
(The PO is generated using "create po" command button)

Private Sub CommandButtoncreate_Click()

Range("a1:I227").AdvancedFilter Action:=xlFilterCopy, CriteriaRange:=Range( _
"k1:K2"), CopyToRange:=Worksheets("Purchase
Order").Range("$a$9:$f$9"), Unique:=False

With Worksheets("Purchase Order")
With .Range("A10:F100")
..sort Key1:=.Range("c10"), Order1:=xlAscending, Header:=xlGuess, _
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _
DataOption1:=xlSortNormal
Sheets("Purchase Order").Activate

End With
End With

End Sub

Thanks
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
print 20 cells with a command button [email protected] Excel Discussion (Misc queries) 5 February 3rd 08 05:57 PM
Print from Command Button Range Garyw Excel Discussion (Misc queries) 8 May 3rd 07 09:17 PM
command button print RKS Excel Discussion (Misc queries) 0 March 23rd 07 10:59 AM
Print range & Command Button TimN Excel Programming 3 November 16th 06 10:30 PM
command button-print Jeff Excel Programming 0 October 12th 04 06:45 PM


All times are GMT +1. The time now is 04:57 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"