Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
Trevor6410
 
Posts: n/a
Default 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   Report Post  
Posted to microsoft.public.excel.misc
Dave Peterson
 
Posts: n/a
Default 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
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
Turning off all Automatic Formatting in Excel 2003 Adam M Excel Discussion (Misc queries) 0 November 4th 05 01:07 PM
Create database in excel? wirthless New Users to Excel 7 October 30th 05 02:57 PM
TRYING TO SET UP EXCEL SPREADSHEET ON MY COMPUTER MEGTOM New Users to Excel 5 October 27th 05 03:06 AM
How do I create a macro, that references another excel file ??? Aries Excel Worksheet Functions 1 May 25th 05 11:37 AM
Automatic links in Excel 2003 Jim Bud Excel Discussion (Misc queries) 4 January 13th 05 03:57 PM


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