i am trying to use vba code to enter the date and time when a certain field
contains data.the code i have tried to use is:
Private Sub Worksheet_Change(ByVal Target As Range)

Application.EnableEvents = False
If Target.Address = "$B$10":"$B$40" Then
Range("A10:A40") = Time
Range("G10:G40") = Date
End If
Application.EnableEvents = True

End Sub
please could you help
thank you John Tempest