I'm using this formula - Loop Through All Excel Files In A Given Folder — TheSpreadsheetGuru
and want to have it automatically select the folder location with no user input
it started off like this
I added the line
.AllowMultiSelect = False
If .Show <> -1 Then GoTo NextCode
myPath = .SelectedItems(1) & "\"
End With[/CODE]
this defaults to that directory so I still have to click ok... not a big issue. close enough work around BUT it causes an issue with saving somehow.
I figured out if I set it to this and then opened the test folder in the dialog box it ran through and saved fine. not sure of the issue
So can I either fix the current issue our be able to set a target folder and it automatically just works from that?
and want to have it automatically select the folder location with no user input
it started off like this
VBA Code:
Set FldrPicker = Application.FileDialog(msoFileDialogFolderPicker)
With FldrPicker
.Title = "Select A Target Folder"
.AllowMultiSelect = False
If .Show <> -1 Then GoTo NextCode
myPath = .SelectedItems(1) & "\"
End With
I added the line
VBA Code:
.InitialFileName = "C:\Users\Admin\register\batch\test\"
VBA Code:
Set FldrPicker = Application.FileDialog(msoFileDialogFolderPicker) into it.
With FldrPicker
.Title = "Select A Target Folder"
.InitialFileName = "C:\Users\Admin\register\batch\test\"
If .Show <> -1 Then GoTo NextCode
myPath = .SelectedItems(1) & "\"
End With[/CODE]
this defaults to that directory so I still have to click ok... not a big issue. close enough work around BUT it causes an issue with saving somehow.
I figured out if I set it to this and then opened the test folder in the dialog box it ran through and saved fine. not sure of the issue
VBA Code:
.InitialFileName = "C:\Users\Admin\register\batch\" ' removed test folder
So can I either fix the current issue our be able to set a target folder and it automatically just works from that?