Command Button Question
Hi Todd
this code should give you what you need
*********
Sub savetodesktop()
Dim pname As String
Dim fname As String
pname = "C:\Windows\Desktop\"
fname = Left(ActiveWorkbook.Name, Len(ActiveWorkbook.Name) - 4)
fname = fname & Format(Now, "ddmmyyyy") & ".xls"
ActiveWorkbook.SaveAs Filename:="" & pname & fname & ""
End Sub
*********
however, depending on what version of windows you're running & how its all
setup this "desktop" might not be the desktop you're seeing as your desktop
so you might need to change the path to something like
"C:\Documents and Settings\All Users\Desktop\"
or instead of All Users your login name
- to get the button you can use either the command button off the control
toolbar or one of the drawing objects (under autoshapes on the drawing
toolbar) .. either way, copy & paste the above code into a module in your
workbook, create the drawing object on the sheet, right mouse click on it
and choose assign macro and choose the savetodesktop macro.
let us know how you go
Cheers
JulieD
"Todd D. Levy" wrote in message
.net...
Greetings,
I would like to place a command button on a worksheet that does the
following:
Save the file to the DESKTOP and at the same time append (the then
current) TODAYS DATE to the filename.
I suspect this is fairly straightforward, but I am new to this, and
would appreciate any guidance.
Regards,
Todd D. Levy
|