Hi all,
Am using the code below to count how many times the 'CmdAdd' button is
pressed, when it has reached the target of 6 i would like to save the
workbook into a temporary file, this bit works but i would like the
file name to be the time and date for the save as this would then not
overwrite previous saves. is this possible using the code below....
Was hoping maybe the 'format Now()' would be possible, but have had no
success with this
HYCH
Static ClickCtr As Long
ClickCtr = ClickCtr + 1
If ClickCtr = 6 Then
ClickCtr = 0
MsgBox "Click OK to Save this File Now "
ActiveWorkbook.SaveCopyAs "c:\goods\"
End If
Steve
JE McGimpsey - 13 Mar 2007 13:15 GMT
This works for me:
Const sPATH As String = "<your path>"
Static ClickCtr As Long
ClickCtr = ClickCtr + 1
If ClickCtr = 6 Then
ClickCtr = 0
MsgBox "Click OK to Save this File Now "
ActiveWorkbook.SaveCopyAs sPATH & _
Format(Now, "yyyymmddhhmmss") & ".xls"
End If
> Hi all,
>
[quoted text clipped - 18 lines]
>
> Steve
K1KKKA - 13 Mar 2007 15:04 GMT
> This works for me:
>
[quoted text clipped - 34 lines]
>
> - Show quoted text -
Exactly what i was after,
many thanks
Steve