Home |
Search |
Today's Posts |
#1
|
|||
|
|||
auto create a file
i have a time card in excel that i'd like to automeate a bit more. right now I have a button on the form to save to a specific file, and it names the new time card by name, date and job #. something like "brianh10/14hilton". people have been asking for copies, and it's tough for me to modify the code for the button to save to their correct path. right now mine saves to something like /mydoc's/time/billing/. Is it possible to code the button so that , if the file doesn't exist, the code can create the correct path. code is as follows: Sub Save_As_FileName() Usr = Range("i5").Value Dte = Format(Range("l1").Value, "mmddyy") Pth = "C:\Documents and Settings\brianh\My Documents\otherjobs\Hay Hill\Time\" ActiveWorkbook.SaveAs Filename:=Pth & Usr & Dte & ".xls", _ FileFormat:=xlNormal, Password:="", WriteResPassword:="", _ ReadOnlyRecommended:=False, CreateBackup:=False End Sub -- -Brian-H- ------------------------------------------------------------------------ -Brian-H-'s Profile: http://www.excelforum.com/member.php...fo&userid=5665 View this thread: http://www.excelforum.com/showthread...hreadid=475245 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Auto save replaced my original file and now I need the original? | Excel Discussion (Misc queries) | |||
Unable to create any link/hyperlinks in a particular excel file | Excel Discussion (Misc queries) | |||
auto update xls document from separate file | Excel Discussion (Misc queries) | |||
Why does Excel automatically create a temporary Word archive file. | Excel Discussion (Misc queries) | |||
Why does Excel create multiple copies of the same file? | Excel Discussion (Misc queries) |