Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,236
Default 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
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
I get error messages in Excel cells once I save a file JeffJake Excel Worksheet Functions 1 November 28th 05 11:06 PM
'document not saved' for 'save' or 'save as' an EXCEL file Judy Chuang Excel Discussion (Misc queries) 1 July 11th 05 10:12 PM
Save & Save As features in file menu of Excel Blue Excel Discussion (Misc queries) 9 December 27th 04 08:49 PM
Save Excel file - prompts to save - no Volitile functions used POWER CERTS Excel Worksheet Functions 2 November 1st 04 09:27 PM
Excel marcos firing on file save as but not file save Andy Excel Programming 1 August 3rd 04 10:34 AM


All times are GMT +1. The time now is 05:40 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"