Consulting

Results 1 to 3 of 3

Thread: How to print 1st page of several excell workbooks

  1. #1

    How to print 1st page of several excell workbooks

    Hi.
    I would like to print 1st page (not whole worksheet) of all the xls in the directory. I can loop through the files and get filename but I dont know how to do the printing part - setting landscape orientation, choosing printer. Would someone help me? Tx. karpatov
    Last edited by karpatov; 09-03-2007 at 02:20 PM.

  2. #2
    Administrator
    2nd VP-Knowledge Base
    VBAX Master malik641's Avatar
    Joined
    Jul 2005
    Location
    Florida baby!
    Posts
    1,533
    Location
    Hi karpatov, Welcome to VBAX

    Record a macro and perform the printing part you're trying to accomplish. Set the landscape, choose the printer, etc. At the end, just do a print preview, then close it and stop macro recording. View the results (you will see many options you can change in the code by doing this). This should help you get started.

    Also, take a look at the Worksheet.PrintOut method in the help files. This should be most of what you need (except for the landscape orientation).

    Good luck!




    New to the forum? Check out our Introductions section to get to know some of the members here. Feel free to tell us a little about yourself as well.

  3. #3
    Administrator
    VP-Knowledge Base VBAX Grand Master mdmackillop's Avatar
    Joined
    May 2004
    Location
    Scotland
    Posts
    14,489
    Location
    Check out this KB Item
    MVP (Excel 2008-2010)

    Post a workbook with sample data and layout if you want a quicker solution.


    To help indent your macros try Smart Indent

    Please remember to mark threads 'Solved'

Posting Permissions

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