• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Macros to save a copy of my current file with current date

srinidhi

Active Member
I have a workbook & I want to save a copy of the Workbook in D Folder with today’s date.

I am using the following code

Sub SaveByDate_TodaysDate()

Dim sFileName As String, sPath As String

sPath = "D: "

sFileName = Format(Now(), "ddmmmyy")

ActiveWorkbook.SaveAs (sPath & sFileName)

End Sub

The problem is after saving the workbook the saved workbook with the current date is open and not the original fine on which I was working on.

I need to save a copy & my original file shld be open for me to work on it.
 
Change this:

Code:
ActiveWorkbook.SaveAs (sPath & sFileName)



To this:



ThisWorkbook.SaveCopyAs (sPath & sFileName & ".xls")


Linky for more info:

http://msdn.microsoft.com/en-us/library/h1e33e36.aspx
 
Back
Top