Hi
Great forum, I am very new to Excel let alone VBA, below is a piece of code I have been workeng on, sure most can see what it does, click the command button it then makes a copy of the workbook into a different location and clears the contents of cells, What i am struggling with is..I want it to clear the contents in the original workbook not the new saved one, so in other words the backup copy keeps the data and the original clears ready for another time....sorry if this is stupid or wrong, maybe easy to some...I am i making any sense???
Private Sub CommandButton13_Click()
Dim nom As String
nom = Day(Date) & "-" & Month(Date) & "-" & Year(Date) & "_" & ActiveWorkbook.Name
ActiveWorkbook.SaveAs Filename:="C:Backup\" & nom
Range("A7:Q20").ClearContents
rep = MsgBox("Copied and Saved to Location X Have a Nice Day : ")
End Sub
Bookmarks