Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 425
Default time stamp based on action in column.

Hi.
I need to place a date stamp on the row in column A, that is triggered
by any action on a row.
I need to place a time stamp on the row in column B, that is triggered
by any action on a row in column C.

1/10/2007 13:54

I have the code for the first one, but need to trigger the time based
on action in C for the second.

Private Sub Worksheet_Change(ByVal Target As Range)
Range("A" & Target.Row) = Date
End Sub

Thanx

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,726
Default time stamp based on action in column.

Private Sub Worksheet_Change(ByVal Target As Range)

Application.EnableEvents = False
On Error Goto ws_exit

If Not Intersect(Target, Me.Colums(3)) Is Nothing Then
Me.Range("B", Target.Row).Value = Time
End If
Me.Range("A" & Target.Row).Value = Date

ws_exit:
Application.EnableEvents = True
On Error Goto 0
End Sub

--
---
HTH

Bob

(change the xxxx to gmail if mailing direct)


"J.W. Aldridge" wrote in message
oups.com...
Hi.
I need to place a date stamp on the row in column A, that is triggered
by any action on a row.
I need to place a time stamp on the row in column B, that is triggered
by any action on a row in column C.

1/10/2007 13:54

I have the code for the first one, but need to trigger the time based
on action in C for the second.

Private Sub Worksheet_Change(ByVal Target As Range)
Range("A" & Target.Row) = Date
End Sub

Thanx



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 425
Default time stamp based on action in column.


Thanx Bob, but date stamp is triggered by column D and the time stamp
is not triggering at all.

If i could get both date (column A) and time (column B) triggered by
the action in the same column (column E) that would be fine as well.

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,124
Default time stamp based on action in column.

At first you say col C, then D, then E. It would be helpful if you decided
which or if any of the three. Also, do you want the date and time in ONE
column or date in one column and time in another?

--
Don Guillett
SalesAid Software

"J.W. Aldridge" wrote in message
oups.com...

Thanx Bob, but date stamp is triggered by column D and the time stamp
is not triggering at all.

If i could get both date (column A) and time (column B) triggered by
the action in the same column (column E) that would be fine as well.



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,726
Default time stamp based on action in column.

You said any action. However..

Private Sub Worksheet_Change(ByVal Target As Range)

Application.EnableEvents = False
On Error Goto ws_exit

If Not Intersect(Target, Me.Colums(3)) Is Nothing Then
Me.Range("B", Target.Row).Value = Time
ElseIf Not Intersect(Target, Me.Colums(4)) Is Nothing Then
Me.Range("A" & Target.Row).Value = Date
End If

ws_exit:
Application.EnableEvents = True
On Error Goto 0
End Sub



--
---
HTH

Bob

(change the xxxx to gmail if mailing direct)


"J.W. Aldridge" wrote in message
oups.com...

Thanx Bob, but date stamp is triggered by column D and the time stamp
is not triggering at all.

If i could get both date (column A) and time (column B) triggered by
the action in the same column (column E) that would be fine as well.





  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 425
Default time stamp based on action in column.

Bob, I tried that one, and the date stamp works fine but, the time
stamp in column B still does not trigger.

Don,
I made some changes to my layout, wasnt trying to complicate things,
would've just changed it to fit the new column. I am good enough to
alter a formula that works but, not quite at the level to write the
formula yet.

The date stamp worked on the formula above. The time stamp didnt for
some reason.

I want the date to populate in column A if any action on the row is
done.
I want the time stamp in (separate) column B, if any action takes place
in column E.

Hope this is clear....

Thanx.

  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,726
Default time stamp based on action in column.

Now I am really confused. Originally, you said any action on a row triggers
the date stamp, then you said the date stamp is triggered by column D, now
you are saying any action again.

Whatever it should be, I had an error. So assuming C & D

Private Sub Worksheet_Change(ByVal Target As Range)

Application.EnableEvents = False
On Error GoTo ws_exit

If Not Intersect(Target, Me.Columns(3)) Is Nothing Then
Me.Range("B" & Target.Row).Value = Time
ElseIf Not Intersect(Target, Me.Columns(4)) Is Nothing Then
Me.Range("A" & Target.Row).Value = Date
End If

ws_exit:
Application.EnableEvents = True
On Error GoTo 0
End Sub

If C and any cell then

Private Sub Worksheet_Change(ByVal Target As Range)

Application.EnableEvents = False
On Error GoTo ws_exit

If Not Intersect(Target, Me.Columns(3)) Is Nothing Then
Me.Range("B" & Target.Row).Value = Time
End If
Me.Range("A" & Target.Row).Value = Date

ws_exit:
Application.EnableEvents = True
On Error GoTo 0
End Sub


--
---
HTH

Bob

(change the xxxx to gmail if mailing direct)


"J.W. Aldridge" wrote in message
ups.com...
Bob, I tried that one, and the date stamp works fine but, the time
stamp in column B still does not trigger.

Don,
I made some changes to my layout, wasnt trying to complicate things,
would've just changed it to fit the new column. I am good enough to
alter a formula that works but, not quite at the level to write the
formula yet.

The date stamp worked on the formula above. The time stamp didnt for
some reason.

I want the date to populate in column A if any action on the row is
done.
I want the time stamp in (separate) column B, if any action takes place
in column E.

Hope this is clear....

Thanx.



  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,124
Default time stamp based on action in column.

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Column < 3 Then Exit Sub
Range("A" & Target.Row) = Date & " " & Time

'or
'Range("A" & Target.Row) = Format(Now(), "mm/yy/dd h:mm")
End Sub


--
Don Guillett
SalesAid Software

"J.W. Aldridge" wrote in message
oups.com...
Hi.
I need to place a date stamp on the row in column A, that is triggered
by any action on a row.
I need to place a time stamp on the row in column B, that is triggered
by any action on a row in column C.

1/10/2007 13:54

I have the code for the first one, but need to trigger the time based
on action in C for the second.

Private Sub Worksheet_Change(ByVal Target As Range)
Range("A" & Target.Row) = Date
End Sub

Thanx



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
Time Stamp Ken Excel Discussion (Misc queries) 2 May 5th 10 01:15 PM
Subtl column A based on column B. Each time B changes pattern? Me Excel Discussion (Misc queries) 1 December 3rd 08 03:50 PM
EXCEL Sum column based on time range in different column? RD975 Excel Worksheet Functions 2 October 13th 05 05:19 PM
time stamp a cell that doesn,t change when time stamping another RC Excel Programming 5 October 13th 05 02:52 AM


All times are GMT +1. The time now is 02:28 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"