Stop a date from updating each successive day

eyecare

New Member
Joined
Aug 27, 2002
Messages
16
This is the function I am using,

IF(C1=0, "", TODAY())

This works, however as you can see the resulting date will change. I would like the date to be fixed and not change.

Would appreciate your help

............... Thanks, Gene Gould OD
 
Excel and bl**dy UK/European dates!

It's because today minus 6 is 12th October. In dd/mm format that's 12/10 but Excel gets confused about what is the day and what is the month and returns 10th December.

I've tried lots of things and the only solution I have found is:

Code:
Sub Test()
    Range("G1").Value = Date - Range("G2").Value
    Range("G1").NumberFormat = "dd/mm/yyyy"
End Sub

This is not good, because one should be able to use the named format "Short Date" to ensure international compatibility. That's why it exists.
 
Upvote 0

Excel Facts

What does custom number format of ;;; mean?
Three semi-colons will hide the value in the cell. Although most people use white font instead.
Thanks, Andrew - yours is considerably shorter.

I'm learning this hit-or-miss, so this is a definite hit!
 
Upvote 0
If you just want a date in a cell not to change, use keyboard shortcut
"CNTRL-semicolon"
"CNTRL-Colon" is time.

To place in cell last time sheet saved, place in vb code under workbook:

Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
Range("update") = "Updated on " & Date & " " & Time
Range("A5").Value = "LAST UPDATED: " & Now
End Sub

name a cell "update"
 
Upvote 0
On 2002-10-18 05:19, Andrew Poulsom wrote:
Excel and bl**dy UK/European dates!

It's because today minus 6 is 12th October. In dd/mm format that's 12/10 but Excel gets confused about what is the day and what is the month and returns 10th December.

I've tried lots of things and the only solution I have found is:

Code:
Sub Test()
    Range("G1").Value = Date - Range("G2").Value
    Range("G1").NumberFormat = "dd/mm/yyyy"
End Sub

This is not good, because one should be able to use the named format "Short Date" to ensure international compatibility. That's why it exists.

Just got back from UNI, much appreciated Andy
 
Upvote 0

Forum statistics

Threads
1,215,646
Messages
6,126,004
Members
449,279
Latest member
Faraz5023

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top