Retrieve Permanent Date and Time

Because of the volatility of Now(), it isn't very useful for stamping a worksheet with the creation or editing date—everytime the workbook is opened, the result of the Now() function gets updated. The following function uses the Now function, but because you need to reenter the cell to update the function, it is much less volatile, as shown in Figure 4.3. DateTime()

No arguments are used with this function.

The cell must be formatted properly to display the date and/or time.

DateTime()

Function example:

Function DateTime() DateTime = Now End Function

Figure 4.3

Retrieve permanent date and time.

Figure 4.3

Retrieve permanent date and time.

0 0

Post a comment