previously posted in the wrong forum.
Sub BackupByDate()
Dim dname As String, strTest As String
dname = ThisWorkbook.Path & "\B" & Format(Now(), "yyyy_mmdd")
strTest = Dir(dname, vbDirectory)
If (strTest = "") Then MkDir (dname)
ActiveWorkbook.SaveCopyAs dname & "\BK_" & Format(Now(),"hh") & "." & Format(Now(),"mm") & "." & Format(Now(), "ss") & "_" & ActiveWorkbook.Name
ActiveWorkbook.Save 'also save current file
End Sub
slightly modified from what I found here:
Sub BackupByDate()
Dim dname As String, strTest As String
dname = ThisWorkbook.Path & "\B" & Format(Now(), "yyyy_mmdd")
strTest = Dir(dname, vbDirectory)
If (strTest = "") Then MkDir (dname)
ActiveWorkbook.SaveCopyAs dname & "\BK_" & Format(Now(),"hh") & "." & Format(Now(),"mm") & "." & Format(Now(), "ss") & "_" & ActiveWorkbook.Name
ActiveWorkbook.Save 'also save current file
End Sub
slightly modified from what I found here: