#1   Report Post  
Posted to microsoft.public.excel.misc
slvtenn
 
Posts: n/a
Default Excel Dates!!

how can i lock a cell to where it want change after save and close.
Example: if i use =TODAY() in a cell, everytime i open that spreadsheet
the current date will appear even after i save it and i need the
original. Any help would be greatly appreciated!!

  #2   Report Post  
Posted to microsoft.public.excel.misc
Doug Kanter
 
Posts: n/a
Default Excel Dates!!


"slvtenn" wrote in message
oups.com...
how can i lock a cell to where it want change after save and close.
Example: if i use =TODAY() in a cell, everytime i open that spreadsheet
the current date will appear even after i save it and i need the
original. Any help would be greatly appreciated!!


Are you saying that you want the date to change every time you open the
sheet, or not?


  #3   Report Post  
Posted to microsoft.public.excel.misc
slvtenn
 
Posts: n/a
Default Excel Dates!!

No i want it to stay with the original date that the sheet was saved.

  #4   Report Post  
Posted to microsoft.public.excel.misc
Doug Kanter
 
Posts: n/a
Default Excel Dates!!


"slvtenn" wrote in message
oups.com...
No i want it to stay with the original date that the sheet was saved.


OK....stay tuned for about an hour. I can't start Excel right now, due to
too many other apps running. But, I did something like this a few years
back, to keep track of how often people were using a sheet I made for them.
Hopefully, I still have it here somewhere. If you want to experiment in the
meanwhile, it was based on two very simple things:

1) If you put the cursor in that date cell which contains =NOW(), do CTRL-C,
then Edit, Paste Special, Value, it'll replace the formula with a static
version of the time at that moment. I recorded these keystrokes - very
simple.

2) It's possible to run a macro every time a sheet's opened or closed. Poke
around on google for "auto open macro excel", and you should also find the
method for running a macro automatically when a sheet closes.

The only thing to think about is that the NEXT time you close the sheet,
that cell will contain the static date, not the =NOW() formula. There are a
few simple ways around this.


  #5   Report Post  
Posted to microsoft.public.excel.misc
Kevin B
 
Posts: n/a
Default Excel Dates!!

You can put the following VBA code in the Workbook module in the OnOpen event
to set the date in cell A1 to the current date if there is not a date value
already present. If there is a date the code does nothing

================================================== ====
Private Sub Workbook_Open()

Dim wb As Workbook
Dim ws As Worksheet
Dim varVal As Variant
Dim r As Range

Set wb = ActiveWorkbook
Set ws = wb.Sheets("Sheet1")
Set r = Range("A1")
varVal = r.Value

If IsDate(varVal) Then
GoTo exitWBOpen
Else
ws.Unprotect
r.Value = Date
ws.Protect
End If

exitWBOpen:

Set wb = Nothing
Set ws = Nothing
Set r = Nothing
Exit Sub

End Sub
================================================== ====
--
Kevin Backmann


"slvtenn" wrote:

how can i lock a cell to where it want change after save and close.
Example: if i use =TODAY() in a cell, everytime i open that spreadsheet
the current date will appear even after i save it and i need the
original. Any help would be greatly appreciated!!




  #6   Report Post  
Posted to microsoft.public.excel.misc
slvtenn
 
Posts: n/a
Default Excel Dates!!

Thanks that worked great!!

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
unhide menu bar in excel - just disappeared Sean Setting up and Configuration of Excel 12 April 4th 23 10:19 AM
Can you export dates in Excel to a calendar? lexi95 Excel Discussion (Misc queries) 1 November 22nd 05 10:10 PM
TRYING TO SET UP EXCEL SPREADSHEET ON MY COMPUTER MEGTOM New Users to Excel 5 October 27th 05 03:06 AM
Excel Range Value issue (Excel 97 Vs Excel 2003) Keeno Excel Discussion (Misc queries) 2 June 13th 05 02:01 PM
Ensure dates imported into Excel 2003 are shown in DD/MM/YYY form. KymY Excel Discussion (Misc queries) 3 February 11th 05 02:28 PM


All times are GMT +1. The time now is 11:47 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"