Discussion Locked

Excel Macros - using SaveAs=ThisFile

0 helpful
1 reply
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

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?

1 reply

by bfilmfan

Add _"C:\excel files\"_ in front of ThisFile.

Of coruse, use whatever drive and folders and subfolders you are really using.

This discussion is closed to new replies.