I'm using the folowing code to create a copy of an excel (in a separate folder) file everytime this gets data changes.
Private Sub Workbook_BeforeClose(Cancel As Boolean)
Dim wb As Workbook, sName As String, sDir As String
sName = Format(Date, "dd-mm-yyyy")
sDir = "P:\starpro\Plateau 1\11 Table Upload\System Static Data\Functional Design\FS Bak"
Set wb = ThisWorkbook
ChDir "P:\starpro\Plateau 1\11 Table Upload\System Static Data\Functional Design\FS Bak\Tables Bak"
.SaveCopyAs .Name & (sName) & ".xls"
The problem is that this is creating a file "file1 and the date.xls" but when I go back in to that file and change some data, this actual code will overwrite the copy everytime.
So I want to have a diferent copy everytime a data is change and not to overwrite the file.
I go once on "File3.xls" i do a change and i get saved as a copy "File3_august6.xls" in ABC folder
I go again to "File3.xls" i do another change and i get saved something like "File3_august6_2.xls" in ABC folder
And keep saving copies everytime data is change.
Thank you very much in advance.