Select folder
Brief description:
Full description:
Code:
Option Explicit Sub SelectFolder() ' Opens dialog box which allows a folder to be selected Dim FolderPath As String With Application.FileDialog(msoFileDialogFolderPicker) If (.Show = -1) Then FolderPath = .SelectedItems(1) & "\" Else Exit Sub End If End With If FolderPath <> "" Then 'Sheet1.Range("A1") = FolderPath Debug.Print FolderPath Exit Sub End If End Sub