Hi...
I have a macro that I run to create a new spreadsheet with some data from my workbook. It works great, however it doesn't give me the option to pick the location where I want to save the spreadsheet to. Here is the current code...
'Get path for desktop of user PC
Path = Environ("USERPROFILE")
ActiveSheet.Range("F4:M" & Range("F" & Rows.Count).End(xlUp).Row).Copy '<-- Adjust range here
'Create new workbook and past copied data in new workbook & save to desktop
Workbooks.add (xlWBATWorksheet)
Selection.PasteSpecial Paste:=xlPasteValuesAndNumberFormats, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
ActiveWorkbook.ActiveSheet.Range("A1").Select
ActiveWorkbook.ActiveSheet.Name = "Sheet1"
ActiveWorkbook.SaveAs Filename:=ThisWorkbook.Path & "\" & "New_" & Format(CStr(Now()), "yyyymmdd\_hhmm") & ".xlsx"
ActiveWorkbook.Close SaveChanges:=True
What I would like to change is when the macro runs it first opens the save file box so that I can select what location on my computer that I want to save the Excel file to instead of defaulting to the desktop. I think I need
to add something like below that is in another macro that does the same thing except for PDF's and it opens the save file box.
vFile = Application.GetSaveAsFilename _
(InitialFileName:=sFile, _
FileFilter:="PDF Files (*.pdf), *.pdf", _
Title:="Select Folder and File Name to save")
Just not sure what to change or how to add it to the first code. Any help pointing me in the right direction would be appreciated.
Thanks!
Bookmarks