rjplante
Well-known Member
- Joined
- Oct 31, 2008
- Messages
- 574
- Office Version
- 365
- Platform
- Windows
I have the get folder location function listed below. I would like the dialogue box that opens to start into a specific root directory. This will allow the user to start at this location which they select the final destination from the list of folders within the root directory. How to I modify the following code so that the dialogue box opens to my desired directory? Is that even possible?
Desired Directory for the dialogue box to start from: T:\Work Files\Active Accounts\
Thanks for the help.
Desired Directory for the dialogue box to start from: T:\Work Files\Active Accounts\
Code:
Function GetFolder_Save_Here () As String
Application.DisplayAlerts = False
Dim fldr As FileDialog
Dim sItem As String
Set fldr = Application.FileDialog(msoFileDialogFolderPicker)
With fldr
.Title = "Select a Folder"
.AllowMultiSelect = False
If .Show <> -1 Then GoTo NextCode
sItem = .SelectedItems(1)
End With
NextCode:
GetFolder = sItem
Set fldr = Nothing
Sheets("Intro Page").Range("AA3").Value = sItem & "\"
Sheets("Intro Page").Range("AA5").Value = sItem
If sItem = "" Then
Exit Function
End If
Application.DisplayAlerts = True
End Function
Thanks for the help.