Hi Everyone,
I'm working on a project where I need to open a spreadsheet with a macro, run a macro in the spreadsheet and save the spreadsheet to a new folder with a slightly modified name. My string of code in VBA reads:
ActiveWorkbook.SaveAs Filename:=Location & Left(myFile, Len(myFile) - 15) & newDate & ".xlsm"
Location is defined as the folder path I need to save to which is fine
Left... just takes the last 15 characters off the file name and changes it to the newDate
When I run the macro, everything works find but it saves the spreadsheet in the current folder and adds the path where I want to save it to the file name at the front. I need to modify the code so it saves it to the Location and saves the file name as the Left...
Thanks for any help,
Matt
I'm working on a project where I need to open a spreadsheet with a macro, run a macro in the spreadsheet and save the spreadsheet to a new folder with a slightly modified name. My string of code in VBA reads:
ActiveWorkbook.SaveAs Filename:=Location & Left(myFile, Len(myFile) - 15) & newDate & ".xlsm"
Location is defined as the folder path I need to save to which is fine
Left... just takes the last 15 characters off the file name and changes it to the newDate
When I run the macro, everything works find but it saves the spreadsheet in the current folder and adds the path where I want to save it to the file name at the front. I need to modify the code so it saves it to the Location and saves the file name as the Left...
Thanks for any help,
Matt