I am writing a sub, where I need the user to open a specific workbook, because I need to copy data from the workbook that will be opened, to the workbook that is running the sub
Function openMontlyReport() as Workbook
MsgBox "Please select the monthly report in the next file dialog"
With Application.FileDialog(msoFileDialogOpen)
.Title = "Select Monthly Report"
.Filters.Add "Excel Files", "*.*"
.AllowMultiSelect = False
If .Show Then Set openMontlyReport = Application.Workbooks.Open .SelectedItems(1)
End With
End Function
Now you have at hand the monthly workbook that the user just opened.