Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11
Default Time/Date Stamp Multiple Rows

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   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default Time/Date Stamp Multiple Rows

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
MULTIPLE DATE/TIME stamp ruben Excel Worksheet Functions 3 May 6th 07 04:28 PM
Date-Time Stamp [email protected] Excel Discussion (Misc queries) 1 September 27th 06 02:37 PM
How do I Time stamp individual rows in excel? lost and confused Excel Discussion (Misc queries) 3 September 12th 05 01:59 AM
date/time stamp Jan Excel Worksheet Functions 7 July 14th 05 01:04 PM
Date/Time stamp with one stroke? Reverse_Solidus Excel Discussion (Misc queries) 10 June 30th 05 01:00 AM


All times are GMT +1. The time now is 12:09 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"