Excel - Get File Path (ends with folder)

PHOTO EMBED

Fri Jun 14 2024 09:16:23 GMT+0000 (Coordinated Universal Time)

Saved by @cmrfreitas

Sub SelectFolder()
    Dim diaFolder As FileDialog
    Dim selected As Boolean

    ' Open the file dialog
    Set diaFolder = Application.FileDialog(msoFileDialogFolderPicker)
    diaFolder.AllowMultiSelect = False
    selected = diaFolder.Show

    If selected Then
        MsgBox diaFolder.SelectedItems(1)
    End If

    Set diaFolder = Nothing
End Sub
content_copyCOPY

https://stackoverflow.com/questions/5971292/get-file-path-ends-with-folder