I want to print specific user define pages from all selected sheets. I
have created a userform with 2 text boxes which the user enters the
page number range
However I can not figure how to get the returned value into my
sht.printout statement
And will this only print the selected workseets or all the worksheets?

Private Sub CommandButton1_Click()
'Print user defined print range from all selected sheets

Dim sht As Variant
Dim Page1, Page2 As Integer
Page1 = Page1_TB.Value ' Textbox input from User Form
Page2 = Page2_TB.Value  ' Textbox input from User Form

For Each sht In ThisWorkbook.Sheets
sht.PrintOut From:=1, To:=1, Copies:=1, Collate:=True
'sht.printout from:page1, to:page2, copies:1, Collate:=true

Next sht


End Sub

-- 
----------------------------------------------------------------------------------
Some important links for excel users:
1. Follow us on TWITTER for tips tricks and links : 
http://twitter.com/exceldailytip
2. Join our LinkedIN group @ http://www.linkedin.com/groups?gid=1871310
3. Excel tutorials at http://www.excel-macros.blogspot.com
4. Learn VBA Macros at http://www.quickvba.blogspot.com
5. Excel Tips and Tricks at http://exceldailytip.blogspot.com
 
To post to this group, send email to excel-macros@googlegroups.com

<><><><><><><><><><><><><><><><><><><><><><>
Like our page on facebook , Just follow below link
http://www.facebook.com/discussexcel

Reply via email to