Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 12
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 29
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 252
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Forms / Templates - automatic sending tonyagrey Excel Discussion (Misc queries) 1 April 15th 10 12:07 PM
I WANT TO KEEP TEMPLATES AND FORMULAS FROM LAST YEAR'S EXCEL FILE cecorjon Excel Discussion (Misc queries) 0 January 6th 10 10:29 PM
Templates - automatic numbering john Excel Discussion (Misc queries) 2 May 18th 06 02:47 PM
How do I put mutliple amortization templates in same file Travis Ritchie Charts and Charting in Excel 0 June 29th 05 03:55 PM
Automatic makros in templates Excel 2003 Peter Excel Programming 0 July 2nd 04 09:36 AM


All times are GMT +1. The time now is 11:35 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"