Hey,
So I just wrote this up quick and may be buggy but I dont have Excel on this computer.
Sub GetPath()
Dim MyPath as String
Dim MyName as String 'Define these however you want. UserForm, or put in a cell, etc...
Dim FileType as String 'Define these however you want. UserForm, or put in a cell, etc...
MyPath = Application.GetOpenFilename 'Opens the Browser Window
If MyPath = False Then 'If no file was selected
MsgBox "Nothing Chosen"
Else
Cells(21, 8) = MyPath 'Define my path
ActiveSheet.SaveAs Filename:=MyPath & "\" & MyName & "." & FileType, FileFormat _ 'Try to Save
:=xlCSVMSDOS, CreateBackup:=False ' Notice that MyName and FileType are defined
End If
End Sub
Just attach that macro to a button.
When you click the button, it brings up a browser window that lets you save the directory.
You can then try to save.
You may also want an Application.DisplayAlerts = False somewhere in the because you will get messages about saving CSVs cause they dont support some of the stuff or something or other.
I know that this reply was very quick and not very thorough.
Let me know if its unclear
Bookmarks