Printing all Excel Files


New Member
Aug 3, 2010

I am working on a project and want to know how to print all excel files from a particular folder. I found some script that lets me browse for a folder just fine, but I am not sure how to print the excel files from that folder. Here is what I have right now.

Sub Test_GetFolder()
  MsgBox GetFolder("Get My Folder", ThisWorkbook.Path)
End Sub

Function GetFolder(Optional sTitle As String = "Select Folder", _
  Optional sInitialFilename As String)
  Dim myFolder As String
  With Application.FileDialog(msoFileDialogFolderPicker)
    If sInitialFilename = "" Then sInitialFilename = ThisWorkbook.Path

    .InitialFileName = sInitialFilename
    .Title = "Greetings"
    If .Show = -1 Then
      GetFolder = .SelectedItems(1)
      If Right(GetFolder, 1) <> "\" Then
            GetFolder = GetFolder & "\"
      End If
      Else: GetFolder = ""
    End If
  End With
End Function

Some videos you may like

Excel Facts

Last used cell?
Press Ctrl+End to move to what Excel thinks is the last used cell.


MrExcel MVP, Junior Admin
Aug 1, 2002
Office Version
Welcome to the Board!

If you do an Advanced Search on this board, and search the Excel forum for "print files folder", and limit the search to "Search Titles Only", you will see some good posts that should give you most of the code you need.

Some of them deal with printing PDFs or TIFFs, but is should be easy enough to change the file extension.

Here is one to get you started.

Subscribe on YouTube

Watch MrExcel Video

Forum statistics

Latest member

This Week's Hot Topics

  • Sort code advice please
    Hi, I have the code below which im trying to edit but getting a little stuck. This was the original code which worked fine,columns A-F would sort...
  • SUMPRODUCT with nested If statement
    Hi everyone, Hope you're all well. I'm hoping someone will be able to point me in the right direction with a problem I'm having with a SUMPRODUCT...
  • VBA - simple sort is killing me!
    Hello all! This should be so easy, but not for me, apparently! I have a table of data that can be of varying lengths and widths. My current macro...
  • Compare Two Lists
    I have two Lists and I need to be able to Identify differences between them. List 100 comes from a workbook - the other is downloaded form the...
  • Formula that deducts points for each code I input.
    I am trying to create a formula that will have each student in my class start at 100 points and then for each code that I enter (PP for Poor...
  • Conditional formatting formula required for day of week and a value
    Hi, I have a really simple spreadsheet where column A is the date, column B is the activity total shown as a number and column C states the day of...