AskForFolder

Asks user to assign a folder, been looking for something like this for awhile now.
Not test yet though, will try it out next chance.
Source = https://www.vbausefulcodes.com/vbausefulcodes/66/selecting-file-or-folder-with-browse-file-option

CodeFunctionName
What is this?

Public

Not Tested

Imported
Function AskForFolder() As String ' Select folder with Browse File Option with VBA
    ' Source = https://www.vbausefulcodes.com/vbausefulcodes/66/selecting-file-or-folder-with-browse-file-option
    ' ##NOT Tested## '
    Dim fldr As FileDialog
    Dim sItem As String
    Set fldr = Application.FileDialog(msoFileDialogFolderPicker)
    With fldr
        .Title = "Select a Folder"
        .AllowMultiSelect = False
        .InitialFileName = ""
        If .Show < > -1 Then GoTo NextCode
        sItem = .SelectedItems(1)
    End With
NextCode:
    Set fldr = Nothing
    AskForFolder = sItem
End Function

None

Views 92

Downloads 41

CodeID
DB ID