Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
michaelberrier
 
Posts: n/a
Default Datestamping a file created by a macro

I have a great macro that puts a worksheet from an open workbook, does
some editing and saves with a specific file name.

And, I found this code he

Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As
Boolean)
Sheets("yourworksheet").Range("desiredrange") = Now
End Sub

to change a cell value from NOW() to the date it was saved.

Now, the problem.

The above code belongs in the ThisWorkbook part of the book's code, and
I don't know where to put that in the macro that creates the workbook
to put it in that part of the new workbook.

Thanks to all.

  #2   Report Post  
Posted to microsoft.public.excel.misc
michaelberrier
 
Posts: n/a
Default Datestamping a file created by a macro

I'm stupid. Here is the code that makes the worksheet. I guess I just
need to know where to put the code above into this so that it ends up
in the ThisWorkbook part.

..SaveAs Filename:="C:\Manifest\Manifest Archive\" &
Worksheets("MANIFEST").Range("C12").Value & " " &
Worksheets("MANIFEST").Range("C13").Value & " " &
Worksheets("MANIFEST").Range("G14").Value & " " &
Worksheets("MANIFEST").Range("D10").Value & " " & Format(Now,
"mm-dd-yyyy hh-mm-ss")
.Close savechanges:=False 'if you're done with it.
ActiveWorkbook.Saved = True
ActiveWorkbook.Close

Thanks.

  #3   Report Post  
Posted to microsoft.public.excel.misc
michaelberrier
 
Posts: n/a
Default Datestamping a file created by a macro


Disregard. This has been solved.

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
Macro to open workbook and copy and paste values in to orig workbo Dena X Excel Worksheet Functions 1 December 15th 05 11:13 PM
I moved a file from work to home and now my color macro does not w nick s Excel Worksheet Functions 2 December 3rd 05 02:39 PM
Open an Excel file with a date as today in a macro Perry Excel Discussion (Misc queries) 4 November 10th 05 09:57 AM
Macro Save File (Unique file name) SJC Excel Worksheet Functions 5 October 27th 05 10:09 PM
File asks to update when no links were created Dave Links and Linking in Excel 1 December 16th 04 08:10 PM


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