Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
How to create Automatic Filenames in Excel
I am trying to work out how to get Excel to automatically create the File
Name when the Workbook is saved. I want a filename to be create using the contents of a given Cell + the current date/time... Ideally, I want a Macro attached to the sheet which Saves the document. |
#2
Posted to microsoft.public.excel.misc
|
|||
|
|||
How to create Automatic Filenames in Excel
Option Explicit
Sub testme03() Dim myFileName As String myFileName = ThisWorkbook.Worksheets("Sheet99").Range("a99").Va lue _ & "--" & Format(Now, "yyyy_mm_dd__hh_mm_ss") & ".xls" ThisWorkbook.SaveAs Filename:=myFileName End Sub Not much testing--no folder included (unless it's in that cell). Trevor6410 wrote: I am trying to work out how to get Excel to automatically create the File Name when the Workbook is saved. I want a filename to be create using the contents of a given Cell + the current date/time... Ideally, I want a Macro attached to the sheet which Saves the document. -- Dave Peterson |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Turning off all Automatic Formatting in Excel 2003 | Excel Discussion (Misc queries) | |||
Create database in excel? | New Users to Excel | |||
TRYING TO SET UP EXCEL SPREADSHEET ON MY COMPUTER | New Users to Excel | |||
How do I create a macro, that references another excel file ??? | Excel Worksheet Functions | |||
Automatic links in Excel 2003 | Excel Discussion (Misc queries) |