#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 103
Default Static date

Hello,

I use =today()-1 in a cell to represent yesterday's date. However, how can
I make it static when saved?

TIA

Hernan
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1,316
Default Static date

Instead of using the TODAY function, just type <CTRL + ; to insert the
current system date as a static entry.

You can also insert the system time as a static entry with <Shift + <CTRL
+ ;

Hope this helps
--
Kevin Backmann


"Hernan" wrote:

Hello,

I use =today()-1 in a cell to represent yesterday's date. However, how can
I make it static when saved?

TIA

Hernan

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,058
Default Static date

enter:
CNTRL-;
rather than:
=TODAY()
--
Gary''s Student - gsnu200778


"Hernan" wrote:

Hello,

I use =today()-1 in a cell to represent yesterday's date. However, how can
I make it static when saved?

TIA

Hernan

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 4
Default Static date

Hi,

Which version of Excel will this work with?

in Excel 2003, <Ctrl+ wants to insert cells.

Stephen

"Gary''s Student" wrote:

enter:
CNTRL-;
rather than:
=TODAY()
--
Gary''s Student - gsnu200778


"Hernan" wrote:

Hello,

I use =today()-1 in a cell to represent yesterday's date. However, how can
I make it static when saved?

TIA

Hernan

  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 4
Default Static date

Hi,

lol - '<Ctrl + ;' or '<Ctrl and ;' pressed simultaneously.

Stephen

"Stephen Eccleston" wrote:

Hi,

Which version of Excel will this work with?

in Excel 2003, <Ctrl+ wants to insert cells.

Stephen

"Gary''s Student" wrote:

enter:
CNTRL-;
rather than:
=TODAY()
--
Gary''s Student - gsnu200778


"Hernan" wrote:

Hello,

I use =today()-1 in a cell to represent yesterday's date. However, how can
I make it static when saved?

TIA

Hernan



  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1,316
Default Static date

The <Ctrl + is not a literal plus sign it means while holding down the
control key, press the semicolon key.

<Ctrl + ;
--
Kevin Backmann


"Stephen Eccleston" wrote:

Hi,

Which version of Excel will this work with?

in Excel 2003, <Ctrl+ wants to insert cells.

Stephen

"Gary''s Student" wrote:

enter:
CNTRL-;
rather than:
=TODAY()
--
Gary''s Student - gsnu200778


"Hernan" wrote:

Hello,

I use =today()-1 in a cell to represent yesterday's date. However, how can
I make it static when saved?

TIA

Hernan

  #7   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 22,906
Default Static date

None of the suggested CTRL + ; will give you yesterday's date.

Your formula will but as you note, wants to update every day.

You could use before_save event code to save the date as static but that would
wipe out the formula.

Maybe don't have a formula and have the event code insert yesterday's date when
the workbook is saved.

Private Sub Workbook_BeforeSave _
(ByVal SaveAsUI As Boolean, Cancel As Boolean)
Sheets("Sheet1").Range("A1").Value = Format(Date - 1, "dd/mm/yyyy")
End Sub


Gord Dibben MS Excel MVP

On Fri, 11 Apr 2008 08:55:00 -0700, Hernan
wrote:

Hello,

I use =today()-1 in a cell to represent yesterday's date. However, how can
I make it static when saved?

TIA

Hernan


  #8   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 103
Default Static date

Hi Gord,

Thank you for noticing that I needed the date for the day before current.

I think your solution is going to work. I need to get rid of the protection.
I will let you know about this.

Thanks again.

Hernan

"Gord Dibben" wrote:

None of the suggested CTRL + ; will give you yesterday's date.

Your formula will but as you note, wants to update every day.

You could use before_save event code to save the date as static but that would
wipe out the formula.

Maybe don't have a formula and have the event code insert yesterday's date when
the workbook is saved.

Private Sub Workbook_BeforeSave _
(ByVal SaveAsUI As Boolean, Cancel As Boolean)
Sheets("Sheet1").Range("A1").Value = Format(Date - 1, "dd/mm/yyyy")
End Sub


Gord Dibben MS Excel MVP

On Fri, 11 Apr 2008 08:55:00 -0700, Hernan
wrote:

Hello,

I use =today()-1 in a cell to represent yesterday's date. However, how can
I make it static when saved?

TIA

Hernan



  #9   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 22,906
Default Static date

What type of protection?

If sheet protection, add an unprotect line at top and a protect line at end.

Private Sub Workbook_BeforeSave _
(ByVal SaveAsUI As Boolean, Cancel As Boolean)
With Sheets("Sheet1")
.Unprotect Password:="justme"
.Range("A1").Value = Format(Date - 1, "dd/mm/yyyy")
.Protect Password:="justme"
End With
End Sub


Gord

On Sat, 12 Apr 2008 21:41:05 -0700, Hernan
wrote:

Hi Gord,

Thank you for noticing that I needed the date for the day before current.

I think your solution is going to work. I need to get rid of the protection.
I will let you know about this.

Thanks again.

Hernan

"Gord Dibben" wrote:

None of the suggested CTRL + ; will give you yesterday's date.

Your formula will but as you note, wants to update every day.

You could use before_save event code to save the date as static but that would
wipe out the formula.

Maybe don't have a formula and have the event code insert yesterday's date when
the workbook is saved.

Private Sub Workbook_BeforeSave _
(ByVal SaveAsUI As Boolean, Cancel As Boolean)
Sheets("Sheet1").Range("A1").Value = Format(Date - 1, "dd/mm/yyyy")
End Sub


Gord Dibben MS Excel MVP

On Fri, 11 Apr 2008 08:55:00 -0700, Hernan
wrote:

Hello,

I use =today()-1 in a cell to represent yesterday's date. However, how can
I make it static when saved?

TIA

Hernan




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
Static date formula Dude3966 Excel Discussion (Misc queries) 3 February 21st 08 09:18 AM
static date Alan g1bdu Excel Worksheet Functions 2 July 3rd 07 12:35 AM
Inserting a static date into a function FIF780 Excel Worksheet Functions 5 February 1st 07 10:39 PM
Static Date Jesse Excel Discussion (Misc queries) 1 September 14th 06 10:24 AM
DATE STATIC Shaggy Excel Worksheet Functions 5 August 22nd 06 02:13 AM


All times are GMT +1. The time now is 02:54 AM.

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"