+ Reply to Thread
Results 1 to 4 of 4

Print Multiple Workbooks from Single Sheet.

Hybrid View

  1. #1
    Registered User
    Join Date
    11-25-2012
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    7

    Post Print Multiple Workbooks from Single Sheet.

    Hi all ,

    Pls help me to get multiple Workbooks prints from Single Sheet.



    I have problem with below code,
    its opens new file , but not printing
    and not closing automatically


    kindly help me.

    code :


    Option Explicit
    Sub Print_Multiple_Excel_Files_in_Single_Click()
    '
    ' Print_Multiple_Excel_Files_in_Single_Click Macro
    '
    ' Keyboard Shortcut: Ctrl+Shift+P
    '
    Dim x As Integer
    Dim Sheet As Object
    Dim Workbook As Workbooks
    
    Dim NumRows As Integer
    ' Set numrows = number of rows of data.
    NumRows = Range("D3", Range("D3").End(xlDown)).Rows.Count
    Range("D3").Select
    ' Establish "For" loop to loop "numrows" number of times.
    For x = 1 To NumRows
    
    
    Sheets("Sheet1").Select
    Range("D1").Activate
    Range("D1") = ActiveCell.Offset(1 + x, 0)
    Workbooks.Open (Range("D1"))
    ActiveWorkbook.PrintOut Copies:=1, Collate:=True
    ActiveWorkbook.Close
    
    ' Step down 1 row from present location.
    ActiveCell.Offset(1, 0).Select
    Next
    
    Sheets("Sheet1").Select
    Range("D1").Activate
    
    End Sub
    Last edited by arlu1201; 02-23-2013 at 02:27 AM. Reason: Corrected code tags.

  2. #2
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,788

    Re: Print Multiple Workbooks from Single Sheet.

    Try this...

    Sub Print_Multiple_Excel_Files_in_Single_Click()
    '
    ' Print_Multiple_Excel_Files_in_Single_Click Macro
    '
    ' Keyboard Shortcut: Ctrl+Shift+P
    '
    Dim x As Integer, NumRows As Integer
    
    ' Establish "For" loop to loop "numrows" number of times.
    Sheets("Sheet1").Select
    
    ' Set numrows = number of rows of data.
    NumRows = Range("D3").End(xlDown).Rows.Count + 1
    
    On Error GoTo NextLoop
     
    For x = 1 To NumRows
        Workbooks.Open (Range("D3").Offset(x, 0).Value)
        ActiveWorkbook.PrintOut Copies:=1, Collate:=True
        ActiveWorkbook.Close
    NextLoop:
    Next
    
    Sheets("Sheet1").Select
    Range("D1").Activate
    
    End Sub


    If your problem is solved, then please mark the thread as SOLVED>>Above your first post>>Thread Tools>>
    Mark your thread as Solved


    If the suggestion helps you, then Click *below to Add Reputation

  3. #3
    Registered User
    Join Date
    11-25-2012
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    7

    Re: Print Multiple Workbooks from Single Sheet.

    Thank You Very Much
    Last edited by arlu1201; 02-23-2013 at 02:59 AM.

  4. #4
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,788

    Re: Print Multiple Workbooks from Single Sheet.

    Glad it helps you and thanks for the feedback

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1