Full Version: Auto
UtterAccess Discussion Forums > Microsoft® Office > Microsoft Excel
ronroth
We are asking our people to take with them a spread sheet to the field and input data (not computer literate). To make it easer for them we would like to automate file saving. We would like to add an automated button that will prompt the user to enter an alpha numeric code and then press another button that will save the file to a designated location and time stamp the file name with the date and the entered code number. I am not adverse in code and would appreciate any help.

Thank you
norie
And your question is?sad.gif
KingMartin
Yes, what is the question?

Would a code like this work for you?

CODE
Const MY_PATH As String = "C:\"
Dim strCode As String
Dim strDate As String
Dim strFileName As String
strCode = Application.InputBox("Enter a code that will be used as a filename:", Type:=2)
If strCode = "False" Then Exit Sub
strDate = Format$(Now(), "yyyymmdd")
strFileName = MY_PATH & strCode & " " & strDate

ThisWorkbook.SaveAs strFileName
ronroth
Yes, I forgot the question... sorry. The code worked great and I thank you very much for your time.

Best Regards,
Ron
KingMartin
You're welcome Ron,

glad to help

Martin
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.