again with the timer thing!!!

  • Thread starter Thread starter Lane
  • Start date Start date
L

Lane

I am currently using this code to enter the time automatically for on
particular column, however, i wanted the same thing to happen i
another set of rows, and it keeps telling me that syntax is invali
when i try to enter the below code the second time. I have been to th
McGimpsey site that Frank sent me a link to, but I cannot get the cod
right for the second timer. Can anyone figure this out?

1st code:

Private Sub Worksheet_Change(ByVal Target As Excel.Range)
With Target
If .Count > 1 Then Exit Sub
If Not Intersect(Range("A2:CL2"), .Cells) Is Nothing Then
Application.EnableEvents = False
If IsEmpty(.Value) Then
.Offset(0, 1).ClearContents
Else
With .Offset(0, 1)
.NumberFormat = "dd mmm yyyy h:mm:ss"
.Value = Now
End With
End If
Application.EnableEvents = True
End If
End With
End Sub


How do I get this to also time stamp a24, when a23 changes
 
Just add it to the main range intersect check...

Private Sub Worksheet_Change(ByVal Target As Excel.Range)
With Target
If .Count > 1 Then Exit Sub
If Not Intersect(Range("A2:CL2,*A23* "), .Cells) Is Nothing Then
Application.EnableEvents = False
If IsEmpty(.Value) Then
.Offset(0, 1).ClearContents
Else
With .Offset(0, 1)
.NumberFormat = "dd mmm yyyy h:mm:ss"
.Value = Now
End With
End If
Application.EnableEvents = True
End If
End With
End Sub
 
I have spend much too long trying to figure that out, Thank you, than
you, thank you!


You have a wonderful day sir!!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top