Forum Discussion
alambaig725
Jan 07, 2022Copper Contributor
I need to know how to print files from a folder(pdf and jpg) using the same order in my excel list
Hi, I have a bunch of documents (pdfs and jpgs) in a folder. I need to print these documents in the same order as the list i have in my excel. the most important thing is that the documents printed ...
alambaig725
Jan 09, 2022Copper Contributor
NikolinoDE the documents saved on my folder are renamed to match with the "D" column.
Instead of searching and printing one by one, I need to know if there is a way to print these documents on the same order as the D column list.
Jan 10, 2022
The following code will access each of the files in column D in the order in which they appear in that column. You will need to come up with the code to open, print, and close the various types of file.
Dim i As Long
With Sheets(1).Range("D1")
For i = 1 To .CurrentRegion.Rows.Count - 1
If .Offset(i, 0) <> "" Then
'put code here to open the file, print it and close it
End If
Next i
End With
Dim i As Long
With Sheets(1).Range("D1")
For i = 1 To .CurrentRegion.Rows.Count - 1
If .Offset(i, 0) <> "" Then
'put code here to open the file, print it and close it
End If
Next i
End With