General discussion
March 2, 2006 at 06:54 AM
autumncrest

Excel Macros – using SaveAs=ThisFile

by autumncrest . Updated 20 years, 8 months ago

I have a file that I want to save each day with the name of the file and the date listed in the file, such as “Company-030106”. I know I can do this with the following code:

ThisFile = Range(“A1”).Value
ActiveWorkbook.SaveAs Filename:=ThisFile

However, I want to save the file in a different directory. When I use the above code, it wants to put the file in the directory that Excel is currently using. So, for example, it may save it on my Desktop if I last went to File, Open and opened a file on the desktop. How do I get the file that I want to save into a certain directory using the “ThisFile” coding above?

This discussion is locked

All Comments