=today()

K

Kanaski79

Ok I have another question.

With the =today() function is there a way to automaticaly make the date a
value so It will not change again, say once you mail the file, or when you
post it to web folder or something?

Thanks guys.

Kevin
 
R

Ron de Bruin

Hi

You must use code to do this or enter the date with a short cut

Ctrl ;

Or with code

Sub test()
ActiveCell.Value = Format(Date, "dd-mmm-yyyy")
End Sub
 
K

Kanaski79

As I am rather new to excell how would I use the code to do this automaticaly
when the file is mailed or saved to a specific location?

Kevin
 
K

Kanaski79

More specificaly only when I mail it.

Kevin

Ron de Bruin said:
Hi

You must use code to do this or enter the date with a short cut

Ctrl ;

Or with code

Sub test()
ActiveCell.Value = Format(Date, "dd-mmm-yyyy")
End Sub
 
K

Kanaski79

I attace it to a mailing in outlook. my documents folder open and the mail
and just drag and drop.

Kevin
 
R

Ron de Bruin

Then it is not possible.

You can use code to automatic insert the last saved date into the file.

Is that a option
 
K

Kanaski79

I just don't want the date to change if my boss emails it to his boss or
whatever.
Would like it to be automatic but if it's realy difficult or impossible I'll
manage.
 
D

Dave H

Kanaski79 said:
I just don't want the date to change if my boss emails it to his boss or
whatever.
Would like it to be automatic but if it's realy difficult or impossible
I'll
manage.

Why don't you try this the other way around - ie create a macro to email it
directly from Excel and change the formula to a value when you do the email
? This will permanently change the formula to it's resulting value.

For instance if your formula "=today()" is in cell B5....

' This is the equivalent of manually selecting the cell, Edit >> Copy,
Edit >> Paste Special, Select VALUE in the paste panel and OK

Range("B5").Select
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:=False, Transpose:=False
ActiveSheet.Paste
Application.CutCopyMode = False

' Code to email the spreadsheet
ActiveWorkbook.SendMail "[email protected]", _
"Today's Spreadsheet"


See Ron de Bruin's Excel tips at http://www.rondebruin.nl/sendmail.htm for
examples.

VBA Email help if you need it....
SendMail Method
Sends the workbook by using the installed mail system.

expression.SendMail(Recipients, Subject, ReturnReceipt)

expression Required. An expression that returns a Workbook object.

Recipients Required Variant. Specifies the name of the recipient as text,
or as an array of text strings if there are multiple recipients. At least
one recipient must be specified, and all recipients are added as To
recipients.

Subject Optional Variant. Specifies the subject of the message. If this
argument is omitted, the document name is used.

ReturnReceipt Optional Variant. True to request a return receipt. False to
not request a return receipt. The default value is False.

Example
This example sends the active workbook to a single recipient.

ActiveWorkbook.SendMail recipients:="Jean Selva"
 
Top