TimeStamp

  • Thread starter Thread starter Steved
  • Start date Start date
S

Steved

Hello from Steved
I've entered the below in a Module (view code then paste)
in Cell B3 I entered = Now I formated it d-mmm.
Please can you explain to me what I have done wrong as it
is diplaying #NAME?

Private Sub Worksheet_Change(ByVal Target As Excel.Range)
With Target
If .Count > 1 Then Exit Sub
If Not Intersect(Range("A2:A10"), .Cells) Is
Nothing Then
Application.EnableEvents = False
If IsEmpty(.Value) Then
.Offset(0, 1).ClearContents
Else
With .Offset(0, 1)
.NumberFormat = "dd mmm"
.Value = Now
End With
End If
Application.EnableEvents = True
End If
End With
End Sub
 
But why would you do that? Besides use

=NOW()

if you want a volatile formula that updates with every calculation.
 
Whoops I need a timestamp to look at a range A5:AB272,
if a cell in that range is changed I need to have a
timestamp in cell B3. Isthis possible.
Cheers
 
Hello Peo from Steved

My understanding of = NOW () works each time the workbook
is opened. I have staff that look into my files hence if
they open it in three days time the Now () will show that
date. What my objective is when I change something in a
range say A5:AA154 the date will change and if the Staff
open the files in 3 days they will see that I updated 3
days ago. Below is what I used in excel97 now I use Excel
2000 Hence Microsoft took the CALL FUNCTION out as it had
the ability for hakers to get into Excel. So I was hoping
that Timestamp would be a good Replacement. Do you have
some FUNCTION that may do this for me.

IF(ROW(A5:AA154),CALL("Xlcall32","Excel4","2JRJ",74))
Thankyou.
 
Hi Steved
for this issue just use the event code from your first
post. This should be the easiest way to create a timestamp
 
Hi
try the following code
Private Sub Worksheet_Change(ByVal Target As Excel.Range)
With Target
If .Count > 1 Then Exit Sub
If Not Intersect(Range("A5:AB272"), .Cells) Is Nothing Then
Application.EnableEvents = False
If Not IsEmpty(.Value) Then
me.range("b3")=now
End If
Application.EnableEvents = True
End If
End With
End Sub
 
Thankyou.
-----Original Message-----
Hi Steved
for this issue just use the event code from your first
post. This should be the easiest way to create a timestamp

.
 
Hello Frank from Steved

Please bare with me on this, I have put the code in by
pushing Alt+F11 then I went and did Go to Insert Module
and pasted the code in this module. If this is right in
cell B3 I typed = now. It has come back with #NAME?

This code I would love to work because it will replace the
CALL FUNCTION. Thanks
 
Back
Top