Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Can I save an excel file as a particular cells value?
I am trying to automatically (through a macro) save an excel file as a date
and time which is the value of the A1 cell. Is there a way to incorporate the A1 cell value in the file name when you go to save as? |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Can I save an excel file as a particular cells value?
Hi Leonard,
Try something like: ActiveWorkbook.SaveAs Format(Range("A1").Value, _ "yyyy-mm-dd @ hh- mm") --- Regards, Norman "Leonard" wrote in message ... I am trying to automatically (through a macro) save an excel file as a date and time which is the value of the A1 cell. Is there a way to incorporate the A1 cell value in the file name when you go to save as? |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Can I save an excel file as a particular cells value?
Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean) Dim str As String If SaveAsUI Then str = Format(Range("A1").Value, "yyyymmddhhmmss") & ".xls" Application.EnableEvents = False Application.Dialogs(xlDialogSaveAs).Show arg1:=str Application.EnableEvents = True Cancel = True End If End Sub -- Rob van Gelder - http://www.vangelder.co.nz/excel "Leonard" wrote in message ... I am trying to automatically (through a macro) save an excel file as a date and time which is the value of the A1 cell. Is there a way to incorporate the A1 cell value in the file name when you go to save as? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
I get error messages in Excel cells once I save a file | Excel Worksheet Functions | |||
'document not saved' for 'save' or 'save as' an EXCEL file | Excel Discussion (Misc queries) | |||
Save & Save As features in file menu of Excel | Excel Discussion (Misc queries) | |||
Save Excel file - prompts to save - no Volitile functions used | Excel Worksheet Functions | |||
Excel marcos firing on file save as but not file save | Excel Programming |