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
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
' 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 94
Downloads 41
CodeID
DB ID
ANmarAmdeen
610
Revisions
v1.0
Thursday
March
23
2023