Consulting

Results 1 to 4 of 4

Thread: Solved: AutoPrint a worksheet

  1. #1

    Solved: AutoPrint a worksheet

    I have make a macro and calculate subtotals. Until now I select manualy all active cells and print.
    I want to run a macro and print automaticaly ,to the default printer, all active worksheet (max 3 pages).

  2. #2
    Administrator
    VP-Knowledge Base
    VBAX Grand Master mdmackillop's Avatar
    Joined
    May 2004
    Location
    Scotland
    Posts
    14,489
    Location
    Two choices. Slightly different outcomes for page numbering in headers/footers

    [VBA]Sub Prints()
    For i = 1 To Sheets.Count
    Sheets(i).PrintOut
    Next
    End Sub

    Sub Prints2()
    Sheets(Array(1, 2, 3)).PrintOut
    End Sub
    [/VBA]
    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'

  3. #3
    Maybe I have made a mistake! I meen to print only one worksheet. And (if it helps the max of pages will be 3 and the columns 5.
    Thanks!

  4. #4
    Administrator
    VP-Knowledge Base VBAX Grand Master mdmackillop's Avatar
    Joined
    May 2004
    Location
    Scotland
    Posts
    14,489
    Location
    If you have set your PrintArea correctly then use
    ActiveSheet.PrintOut

    Recording a simple macro for such tasks will give you the basic code.
    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
  •