auto create a file

B

-Brian-H-

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top