Hello all,
I have a folder that averages 100+ excel files per week that I need to print.
However, I need to be able to print them in order based from a list in Excel (either by file name (column A) or a sequence number (column D) ) not the order they are found in the folder so I don't have to manually sort them each time, any ideas?
appreciate your assistance
The code below works great but prints the entire folder in random order
I have a folder that averages 100+ excel files per week that I need to print.
However, I need to be able to print them in order based from a list in Excel (either by file name (column A) or a sequence number (column D) ) not the order they are found in the folder so I don't have to manually sort them each time, any ideas?
appreciate your assistance
The code below works great but prints the entire folder in random order
Code:
Sub PrintAllWorkbooks()
'Step 1:Declare your variables
Dim MyFiles As String
'Step 2: Specify a target folder/directory
MyFiles = Dir("[URL="file://\\us108fp00\data\Krshare\QIP"]\\us108fp00\data\Krshare\QIP[/URL] conversions\PrintQIPTempFile\*.xls*")
Do While MyFiles <> ""
'Step 3: Open Workbooks one by one
Workbooks.Open "[URL="file://\\us108fp00\data\Krshare\QIP"]\\us108fp00\data\Krshare\QIP[/URL] conversions\PrintQIPTempFile" & MyFiles
'ActiveWorkbook.Sheets("Sheet1").PrintOut Copies:=1
Dim sht
Dim ShtName
ShtName = Array("*Rev*") 'ADD SHEET NAMES HERE NOT TO PRINT
For I = 1 To Worksheets.Count
For J = 0 To UBound(ShtName)
If LCase(Worksheets(I).Name) Like LCase(ShtName(J)) Then Count = 1
Next J
If Count = 0 Then Worksheets(I).PrintOut copies:=1
Count = 0
Next I
ActiveWorkbook.Close SaveChanges:=False
'Step 4: Next File in the Directory
MyFiles = Dir
Loop
End Sub