Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Automatic File Name from Templates
Hello there,
Does any one know if it is possible to pickup a text value from a precise cell and assign it as a file name? I have prepared a Template and on save as I would like to pickup the text inserted into call C3 and save this new file into a directory C:\mydir. Thank you Alan |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Automatic File Name from Templates
Sub UserFileSave()
Dim Fname, Suggestion, Hdr Suggestion = Range("c3").Value Hdr = "Please choose a Location and Name then click Save." On Error GoTo ERRH Fname = Application.GetSaveAsFilename(Suggestion, fileFilter:="ExcelFile(*.xls), *.xls)", Title:=Hdr) If Fname = False Then 'Handle Cancel 'UserCancel Else ThisWorkbook.SaveAs Filename:=Fname End If Exit Sub ERRH: On Error GoTo 0 MsgBox "Try another Name" UserFileSave End Sub |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Automatic File Name from Templates
Or if you want to automate it without giving the user the option:
ThisWorkbook.SaveAs Filename:=Range("C3").Value or perhaps something like: ThisWorkbook.SaveAs Filename:=Range("C3").Value & Format(Date, " mm-dd-yy") "alanford" wrote: Hello there, Does any one know if it is possible to pickup a text value from a precise cell and assign it as a file name? I have prepared a Template and on save as I would like to pickup the text inserted into call C3 and save this new file into a directory C:\mydir. Thank you Alan |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Forms / Templates - automatic sending | Excel Discussion (Misc queries) | |||
I WANT TO KEEP TEMPLATES AND FORMULAS FROM LAST YEAR'S EXCEL FILE | Excel Discussion (Misc queries) | |||
Templates - automatic numbering | Excel Discussion (Misc queries) | |||
How do I put mutliple amortization templates in same file | Charts and Charting in Excel | |||
Automatic makros in templates Excel 2003 | Excel Programming |