Hello,
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.
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.
Code:
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