I'm writing vba to print all files listed in a table column. The macro works for one filename however, I'm not sure how to loop through the rest of the column to print all the workbooks?
The folder path is located (Sheet9.name).Range("D2")
The file names are located in column A5 and down
This code works for the first Cell in the column A5
Dim sourcefolder As String
Dim sourcefile As String
sourcefolder = (Worksheets(Sheet9.name).Range("D2"))
sourcefile = Range("A5")
Workbooks.Open (sourcefolder) & (sourcefile)
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True, IgnorePrintAreas:=False
ActiveWindow.Close
How do I loop through changing the file name to contained in the next cell?
The folder path is located (Sheet9.name).Range("D2")
The file names are located in column A5 and down
This code works for the first Cell in the column A5
Dim sourcefolder As String
Dim sourcefile As String
sourcefolder = (Worksheets(Sheet9.name).Range("D2"))
sourcefile = Range("A5")
Workbooks.Open (sourcefolder) & (sourcefile)
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True, IgnorePrintAreas:=False
ActiveWindow.Close
How do I loop through changing the file name to contained in the next cell?