This code opens a file dialog box for the user to select a file, and then returns the file path.
VBA Code:
Function OpenFileDialog() As String
Dim dialog As FileDialog
Dim result As Integer
Set dialog = Application.FileDialog(msoFileDialogFilePicker)
result = dialog.Show
If result <> 0 Then
OpenFileDialog = dialog.SelectedItems(1)
Else
OpenFileDialog = ""
End If
End Function