=NOW() in cell without change next day

  • Thread starter Thread starter Stefan Buijs
  • Start date Start date
S

Stefan Buijs

Hello,

I do have several worksheets with a date field that will be filled in on the
day itself and save the workbook every day.
How can I use =NOW() in a field and how will it fixed in this cell without
chang the next day.

Stefan
 
Stefan, how about using Ctrl+; for the date or Ctrl+shift+: for the time, or
both for the date and time

--
Paul B
Always backup your data before trying something new
Using Excel 2000 & 97
Please post any response to the newsgroups so others can benefit from it
** remove news from my email address to reply by email **
 
It is not a matter of doeing it as well it may not be changed by the user
who gives the input as well day's or month later when the file is opened
again this date must be as the org date and not the =now() from that day
month later.

Stefan
 
Stefan, if you use Ctrl+; the date will not change, if you want the date to
be put in "automatically" and not change you will need some VBA to do it,
something like this, will put the date in A1 when the worksheet is selected,
will not put the date in if there is something in A1

Private Sub Worksheet_Activate()
If Not (IsEmpty(Range("A1"))) Then
Else
[A1].Value = Now
[A1].NumberFormat = "m/dd/yyy"
End If

End Sub


--
Paul B
Always backup your data before trying something new
Using Excel 97 & 2000
Please post any response to the newsgroups so others can benefit from it
** remove news from my email address to reply by email **
 
This works but only I have to change the sheet first beforethe date appears.
Maby I did not set this code in the right sheet?
I did put it in the sheet 1, if I put it in this workbook the code does not
work.

Stefan
Paul B said:
Stefan, if you use Ctrl+; the date will not change, if you want the date to
be put in "automatically" and not change you will need some VBA to do it,
something like this, will put the date in A1 when the worksheet is selected,
will not put the date in if there is something in A1

Private Sub Worksheet_Activate()
If Not (IsEmpty(Range("A1"))) Then
Else
[A1].Value = Now
[A1].NumberFormat = "m/dd/yyy"
End If

End Sub


--
Paul B
Always backup your data before trying something new
Using Excel 97 & 2000
Please post any response to the newsgroups so others can benefit from it
** remove news from my email address to reply by email **


Stefan Buijs said:
It is not a matter of doeing it as well it may not be changed by the user
who gives the input as well day's or month later when the file is opened
again this date must be as the org date and not the =now() from that day
month later.

Stefan
time,
in
 
Stefan, when do you want the date put in? In what cell? Maybe something like
this would work better for you, will put the date in B1 when something is
put in A1, put in sheet code for the sheet(s) you want

Private Sub Worksheet_Change(ByVal Target As Excel.Range)
'will put the date in B1 when something is put in A1
If Intersect(Target, Range("A1")) Is Nothing Then Exit Sub
With Target
.Offset(, 1).Value = Now
.Offset(, 1).NumberFormat = "m/d/yyyy"
End With
End Sub
--
Paul B
Always backup your data before trying something new
Using Excel 97 & 2000
Please post any response to the newsgroups so others can benefit from it
** remove news from my email address to reply by email **


Stefan Buijs said:
This works but only I have to change the sheet first beforethe date appears.
Maby I did not set this code in the right sheet?
I did put it in the sheet 1, if I put it in this workbook the code does not
work.

Stefan
Paul B said:
Stefan, if you use Ctrl+; the date will not change, if you want the date to
be put in "automatically" and not change you will need some VBA to do it,
something like this, will put the date in A1 when the worksheet is selected,
will not put the date in if there is something in A1

Private Sub Worksheet_Activate()
If Not (IsEmpty(Range("A1"))) Then
Else
[A1].Value = Now
[A1].NumberFormat = "m/dd/yyy"
End If

End Sub


--
Paul B
Always backup your data before trying something new
Using Excel 97 & 2000
Please post any response to the newsgroups so others can benefit from it
** remove news from my email address to reply by email **


Stefan Buijs said:
It is not a matter of doeing it as well it may not be changed by the user
who gives the input as well day's or month later when the file is opened
again this date must be as the org date and not the =now() from that day
month later.

Stefan
Stefan, how about using Ctrl+; for the date or Ctrl+shift+: for the time,
or
both for the date and time

--
Paul B
Always backup your data before trying something new
Using Excel 2000 & 97
Please post any response to the newsgroups so others can benefit
from
 
Back
Top