Keep todays date, tomorrow

K

KJ

On a quoting file I use, I use today's date as =today()
Just one less field I have to enter. Is there a formula I'm missing that
would save the date I created or saved the file?
ei: I open my generic/blank file today on 1/8, save it as a quote number. I
want the quote to say 1/8 'til the end of time. Is there a formula that will
pull the saved date instead of "today()"?
Thanks
 
B

Bill Kuunders

Say your date is in cell G1 on sheet1
enter the macro below into the workbook code.
To get there ,,,,,,,,right click onto the excel sign next to the "file" menu
on the top menu bar
select view code

select "workbook" in the top left dropdown and "before save" in the right
dropdown


You'll see.............
Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As
Boolean)
End Sub

Copy the following lines............and paste them between Private
Sub...........and End Sub

Sheet1.Select
Range("g1").Copy
Range("G1").PasteSpecial Paste:=xlPasteValues
Application.CutCopyMode = False

So the end result will be...............

Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As
Boolean)
Sheet1.Select
Range("G1").Copy
Range("G1").PasteSpecial Paste:=xlPasteValues
Application.CutCopyMode = False
End Sub

From now each time you save the workbook the contents of cell G1 will be
copied and pasted
as a value.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top