#1   Report Post  
AccessHelp
 
Posts: n/a
Default now()

Good morning,

How can I make the now() function static?

What I am trying to do is we submit our timesheet every week. I have a
macro set up to write the date that submit in Cell F1 using now(). The
problem is when we open the same timesheet next time, the date will change to
that current date.

I want the date to be the same date that I submit my timesheet and want the
date to be in the format "10/26/05". I tried using quotes around the now()
function, and it returns value instead of date.

Any other suggestions are welcomed. Thanks.
  #2   Report Post  
Ian
 
Posts: n/a
Default now()

If you are using a macro to enter the date, first test the value of F1 to
see if it is blank.

If Range("F1").Value = "" Then Range("F1").Value = Now()

--
Ian
--
"AccessHelp" wrote in message
...
Good morning,

How can I make the now() function static?

What I am trying to do is we submit our timesheet every week. I have a
macro set up to write the date that submit in Cell F1 using now(). The
problem is when we open the same timesheet next time, the date will change
to
that current date.

I want the date to be the same date that I submit my timesheet and want
the
date to be in the format "10/26/05". I tried using quotes around the
now()
function, and it returns value instead of date.

Any other suggestions are welcomed. Thanks.



  #3   Report Post  
Gary''s Student
 
Posts: n/a
Default now()

You must be putting the function NOW() in F1. Try this tiny macro:

Sub mac()
Cells(1, 6) = Now()
End Sub

This put the value of NOW() in F1. It will not change unless you run the
macro again.
--
Gary''s Student


"AccessHelp" wrote:

Good morning,

How can I make the now() function static?

What I am trying to do is we submit our timesheet every week. I have a
macro set up to write the date that submit in Cell F1 using now(). The
problem is when we open the same timesheet next time, the date will change to
that current date.

I want the date to be the same date that I submit my timesheet and want the
date to be in the format "10/26/05". I tried using quotes around the now()
function, and it returns value instead of date.

Any other suggestions are welcomed. Thanks.

  #5   Report Post  
topola
 
Posts: n/a
Default now()

Try using those macros to switch between Auto & Manual Calculation.

Sub Calcul_Manual()
Application.Calculation = xlManual
End Sub

Sub Calcul_Auto()
Application.Calculation = xlAutomatic
End Sub

I'd recommend putting two macro buttons in your worksheet.

And this procedure will switch to Manual when the file is closed:

Sub Auto_Close
Calcul_Manual
End Sub

---
Tomek Polak, http://vba.blog.onet.pl



  #6   Report Post  
topola
 
Posts: n/a
Default now()

Sorry, this was not precise. Calculation is a general trait for the
whole Excel, not for one workbook.

Public Calcul_Status ' will remember if Manual or Auto on Open =
Default

Sub Auto_Open()
Calcul_Status = Application.Calculation
Calcul_Manual ' forces Manual Calculation
End Sub

Sub Auto_Close()
Application.Calculation = Calcul_Status ' returns to the Default
End Sub

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



All times are GMT +1. The time now is 11:04 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"