ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Auto Update Time When Cell Changes (https://www.excelbanter.com/excel-programming/361383-auto-update-time-when-cell-changes.html)

Anthony

Auto Update Time When Cell Changes
 
I have an Excel spreadsheet that multiple people will use.

I would like my date column (H) to automatically update when the users
update any of their numbers (columns D, E, and F) so I can track when their
last update occured.

I'm sure this would be some form of Worksheet_Change event, but I can't find
a site that adequately describes events for my skill level.

Thank you,
Anthony

Don Guillett

Auto Update Time When Cell Changes
 
You can do that with a worksheet_change event but won't just =now() in a
cell work for you?

--
Don Guillett
SalesAid Software

"Anthony" wrote in message
...
I have an Excel spreadsheet that multiple people will use.

I would like my date column (H) to automatically update when the users
update any of their numbers (columns D, E, and F) so I can track when
their
last update occured.

I'm sure this would be some form of Worksheet_Change event, but I can't
find
a site that adequately describes events for my skill level.

Thank you,
Anthony




JE McGimpsey

Auto Update Time When Cell Changes
 
Try

http://www.mcgimpsey.com/excel/timestamp.html

In article ,
Anthony wrote:

I have an Excel spreadsheet that multiple people will use.

I would like my date column (H) to automatically update when the users
update any of their numbers (columns D, E, and F) so I can track when their
last update occured.

I'm sure this would be some form of Worksheet_Change event, but I can't find
a site that adequately describes events for my skill level.

Thank you,
Anthony


Anthony

Auto Update Time When Cell Changes
 
Okay, the following code from that site should produce the results I want,
but now I need to know how to activate it... nothing I've tried has produced
anything but #NAME?.

Using a worksheet event macro.
Let's say that every time an entry is made in cells A2:A10, the
corresponding cell in column B should have the date and time entered. You
could use this Worksheet_Change() macro - put it in the worksheet code module:

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


"JE McGimpsey" wrote:

Try

http://www.mcgimpsey.com/excel/timestamp.html

In article ,
Anthony wrote:

I have an Excel spreadsheet that multiple people will use.

I would like my date column (H) to automatically update when the users
update any of their numbers (columns D, E, and F) so I can track when their
last update occured.

I'm sure this would be some form of Worksheet_Change event, but I can't find
a site that adequately describes events for my skill level.

Thank you,
Anthony



Don Guillett

Auto Update Time When Cell Changes
 
I just tested this code in xl2002 and it worked just fine. However, it needs
to be put in the worksheet module where you want to run it. Right click
sheet tabview codeput it thereremove from where you put it. SAVE

--
Don Guillett
SalesAid Software

"Anthony" wrote in message
...
Okay, the following code from that site should produce the results I want,
but now I need to know how to activate it... nothing I've tried has
produced
anything but #NAME?.

Using a worksheet event macro.
Let's say that every time an entry is made in cells A2:A10, the
corresponding cell in column B should have the date and time entered. You
could use this Worksheet_Change() macro - put it in the worksheet code
module:

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


"JE McGimpsey" wrote:

Try

http://www.mcgimpsey.com/excel/timestamp.html

In article ,
Anthony wrote:

I have an Excel spreadsheet that multiple people will use.

I would like my date column (H) to automatically update when the users
update any of their numbers (columns D, E, and F) so I can track when
their
last update occured.

I'm sure this would be some form of Worksheet_Change event, but I can't
find
a site that adequately describes events for my skill level.

Thank you,
Anthony





Mike G - D.C.

Auto Update Time When Cell Changes
 
I'm new to this; hopefully you may be able to help. The scenario that Anthony
describes within the previous post is similar to my needs, with a few
differences. The most significant difference is that some of the values
within my workbook are updated using formulas rather than user input. I've
been able to alter the code from the website so that it works with values
that are user-entered. Unfortunately though, I've been unsuccessful when
referring to cells containing formulas. I've added some sample code below.
In this example, values in Range B2:B10 are populated from values within
another worksheet contained within the same workbook. Any help is much
appreciated.
Thanks, Mike


Private Sub Worksheet_Change(ByVal Target As Excel.Range)
With Target
If .Count 1 Then Exit Sub
If Not Intersect(Range("A2:A10"), .Cells) Is Nothing Then
Application.EnableEvents = False
If IsEmpty(.Value) Then
.Offset(0, 5).ClearContents
Else
With .Offset(0, 5)
.Value = "x"
End With
End If
Application.EnableEvents = True
End If
End With
With Target
If .Count 1 Then Exit Sub
If Not Intersect(Range("B2:B10"), .Cells) Is Nothing Then
Application.EnableEvents = False
If IsEmpty(.Value) Then
.Offset(0, 4).ClearContents
Else
With .Offset(0, 4)
.Value = "x"
End With
End If
Application.EnableEvents = True
End If
End With
End Sub



"JE McGimpsey" wrote:

Try

http://www.mcgimpsey.com/excel/timestamp.html

In article ,
Anthony wrote:

I have an Excel spreadsheet that multiple people will use.

I would like my date column (H) to automatically update when the users
update any of their numbers (columns D, E, and F) so I can track when their
last update occured.

I'm sure this would be some form of Worksheet_Change event, but I can't find
a site that adequately describes events for my skill level.

Thank you,
Anthony




All times are GMT +1. The time now is 07:14 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com