Results 1 to 4 of 4

Thread: Command button for printing multi pages

  1. #1

    Thread Starter
    New Member
    Join Date
    Apr 2003
    Location
    Durham,NC
    Posts
    12

    Command button for printing multi pages

    I have a workbook that has about 20 sheets in it. I have a command button the the summary page that says "Print Qutoe"
    What do I need to do so that when the button is pushed it will print only the pages that I want it to? (lets say sheet 2,4,8,12,17,&19) and not the others.
    Kimberly

  2. #2
    Fanatic Member WorkHorse's Avatar
    Join Date
    Jul 2002
    Location
    Where you live.
    Posts
    591
    The PrintOut method allows you to pass the beginning and ending pages that you want to print. From Excel help files:

    PrintOut Method

    Prints the object.

    Syntax

    expression.PrintOut(From, To, Copies, Preview, ActivePrinter, PrintToFile, Collate, PrToFileName)

    expression Required. An expression that returns an object in the Applies To list.

    From Optional Variant. The number of the page at which to start printing. If this argument is omitted, printing starts at the beginning.

    To Optional Variant. The number of the last page to print. If this argument is omitted, printing ends with the last page.

  3. #3

    Thread Starter
    New Member
    Join Date
    Apr 2003
    Location
    Durham,NC
    Posts
    12
    Thank you for you reply, but I am not sure if I understand what you gave me or If I did explain what I needed to learn how to do??

    Will what you gave me allow me to print out specified worksheets in an excel workbook?

    And since I am VERY new to VP I am not really sure of how to make it work with a command button??

    Please advise? Thanks!!
    Kimberly

  4. #4
    Hyperactive Member
    Join Date
    Aug 2004
    Location
    Bloomingdale, IL USA
    Posts
    284
    I don't know if you still need help with this. But what you could do is hide all the sheets that you do not want to be printed, then just print out the workbook.

    Example:

    Sheets("sheet1").visible = false
    Sheets("sheet3").visible = false

    Application.Activeworkbook.printout


    This will print out all the sheets that are visible.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width