Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
I am using the following code:
Private Sub Worksheet_Change(ByVal Target As Range) Application.EnableEvents = False If Not Application.Intersect(Target, Range("B16:F74")) Is Nothing Then Range("G16:G74") = Now Application.EnableEvents = True End If End Sub I get the same time and date in all the rows. How can I fix my code so that it is row specific. |
#2
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Maybe something like:
Option Explicit Private Sub Worksheet_Change(ByVal Target As Range) Dim myRow As Long If Target.Cells.Count 1 Then Exit Sub 'one cell at a time End If If Application.Intersect(Target, Me.Range("B16:F74")) Is Nothing Then 'do nothing Else myRow = Target.Row With Me.Cells(myRow, "G") .NumberFormat = "mm/dd/yyyy hh:mm:ss" Application.EnableEvents = False .Value = Now Application.EnableEvents = True End With End If End Sub DataGuy wrote: I am using the following code: Private Sub Worksheet_Change(ByVal Target As Range) Application.EnableEvents = False If Not Application.Intersect(Target, Range("B16:F74")) Is Nothing Then Range("G16:G74") = Now Application.EnableEvents = True End If End Sub I get the same time and date in all the rows. How can I fix my code so that it is row specific. -- Dave Peterson |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
MULTIPLE DATE/TIME stamp | Excel Worksheet Functions | |||
Date-Time Stamp | Excel Discussion (Misc queries) | |||
How do I Time stamp individual rows in excel? | Excel Discussion (Misc queries) | |||
date/time stamp | Excel Worksheet Functions | |||
Date/Time stamp with one stroke? | Excel Discussion (Misc queries) |