Hi
On my computer - in devices and printer I can select a PDF creater as the default printer - so I don't know how it would work for those that don't have this option. I guess if anyone didn't have that it might print out to a normal printer? Works well for me this way as I have a set 'print area' that is on every page.
here is the final code
Option Explicit
Sub ExtrData()
Dim MyFolder As String 'Store the folder selected by the user
Dim sFile As String 'The name of the file where data is selected for printing
Dim wk As Workbook
Dim pFile As String
On Error Resume Next
Application.ScreenUpdating = False
'Display the folder picker dialog box for user selection of directory
With Application.FileDialog(msoFileDialogFolderPicker)
.Title = "Please select a folder"
.Show
.AllowMultiSelect = False
If .SelectedItems.Count = 0 Then
MsgBox "You did not select a folder"
Exit Sub
End If
MyFolder = .SelectedItems(1) & "\"
End With
'Dir finds the files in the selected folder, to specify a specific filetype replace xlsx with proper file ending
sFile = Dir(MyFolder & "*.xlsx")
If sFile = "" Then
MsgBox "No files matching set criteria found"
Exit Sub
End If
Do While sFile <> ""
Set wk = Workbooks.Open(MyFolder & sFile)
Sheets("Register").Activate
pFile = Mid(sFile, 1, Len(sFile) - 4)
ActiveWindow.SelectedSheets.PrintOut From:=1, To:=1, Copies:=1, Collate _
:=True, IgnorePrintAreas:=False
Columns("E:R").Select
Range("E3").Activate
Selection.EntireColumn.Hidden = True
wk.Close SaveChanges:=True
sFile = Dir()
Loop
Application.ScreenUpdating = True
End Sub
Thanks again
Bookmarks