The script below writes a ".csv" file to the same directory that contains the workbook the macro, "foo" is run from. I'd like help to change the script to always write the file to a separate directory which is: "c:\etc\upload"
Sub Foo()
Dim wbSource As Workbook
Dim wsSource As Worksheet
Dim wbDest As Workbook
Dim fName As String
fName = Range("F1")
'References
Set wbSource = ActiveWorkbook
Set wsSource = ActiveSheet
Set wbDest = Workbooks.Add
'Copy range on original sheet
wsSource.Range("Q26:AX230").Copy
'----------------------------
'Save in new workbook
wbDest.Worksheets(1).Cells(1, 1).PasteSpecial Paste:=xlPasteValuesAndNumberFormats
Application.CutCopyMode = False
'Save new csv file
wbDest.SaveAs fName, xlCSV
wbDest.Close SaveChanges:=True
'----------------------------
End Sub
Bookmarks