Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Timestamp a cell when row is updated.

I am looking for a solution.

My spreadsheet has 5 columns that i do not want this to affect. The 6th
column is "Last Updated".

When i write comments in any cell after H i want it to put the updated date
and time into "Last Updated" in that row.

Another addition to this would be to check the last updated date, if it is
upto 3days from today then turn green, upto 5days yellow and more than 7days
red!

I hope someone can help!
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,501
Default Timestamp a cell when row is updated.

Hi,

generally this is very easy and the code is below but your question isn't
clear.

Is the 'Last updated' column different for every tow?

Anyway try this. Right click your sheet tab, view code and paste the code
below in

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Cells.count 1 Or IsEmpty(Target) Then Exit Sub
If Not Intersect(Target, Range("G1:z100")) Is Nothing Then
Application.EnableEvents = False
Cells(Target.Row, 6) = Now
Application.EnableEvents = True
End If
End Sub

Mike

"BakerInSpain" wrote:

I am looking for a solution.

My spreadsheet has 5 columns that i do not want this to affect. The 6th
column is "Last Updated".

When i write comments in any cell after H i want it to put the updated date
and time into "Last Updated" in that row.

Another addition to this would be to check the last updated date, if it is
upto 3days from today then turn green, upto 5days yellow and more than 7days
red!

I hope someone can help!

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8,520
Default Timestamp a cell when row is updated.

The below will point you in the right direction. Select the sheet tab which
you want to work with. Right click the sheet tab and click on 'View Code'.
This will launch VBE. Paste the below code to the right blank portion. Get
back to to workbook and try out.

--Events logged for changes after column H ie from col I onwards
--upto 3 days is colored as green, upto 7 days is colored as yellow and
greater than 7 is coloured as red..You can change that to suit

Private Sub Worksheet_Activate()
lngLastRow = ActiveSheet.Cells(Rows.Count, "f").End(xlUp).Row
For lngrow = 2 To lngLastRow
If Range("F" & lngrow) < "" Then
Select Case DateDiff("d", Range("F" & lngrow), Date)
Case Is <= 3
Range("F" & lngrow).Interior.ColorIndex = 10
Case Is <= 7
Range("F" & lngrow).Interior.ColorIndex = 6
Case Else
Range("F" & lngrow).Interior.ColorIndex = 3
End Select
End If
Next
End Sub

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Column 8 Then
Range("f" & Target.Row) = Now
Range("f" & Target.Row).Interior.ColorIndex = 10
End If
End Sub


If this post helps click Yes
---------------
Jacob Skaria


"BakerInSpain" wrote:

I am looking for a solution.

My spreadsheet has 5 columns that i do not want this to affect. The 6th
column is "Last Updated".

When i write comments in any cell after H i want it to put the updated date
and time into "Last Updated" in that row.

Another addition to this would be to check the last updated date, if it is
upto 3days from today then turn green, upto 5days yellow and more than 7days
red!

I hope someone can help!

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 747
Default Timestamp a cell when row is updated.

Right click on sheet tab

Paste this code

Private Sub Worksheet_Change(ByVal Target As Range)

If Target.Column = 8 And Target.Column <= 12 Then
CurR = Target.Row
Range("F" & CurR).Value = Now
End If

End Sub

For Coloring use the conditional formatting

to color Green - use this
=TODAY()-INT(F2)<=3

to color Yellow - use this
=AND((TODAY()-INT(F2))3,(TODAY()-INT(F2))<=5)

to color Red - use this
=TODAY()-INT(F2)7

What about if the last updated in last 6 days ?


On Nov 16, 5:01*pm, BakerInSpain
wrote:
I am looking for a solution.

My spreadsheet has 5 columns that i do not want this to affect. The 6th
column is "Last Updated".

When i write comments in any cell after H i want it to put the updated date
and time into "Last Updated" in that row.

Another addition to this would be to check the last updated date, if it is
upto 3days from today then turn green, upto 5days yellow and more than 7days
red!

I hope someone can help!


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
Excel cells randomly don't get updated unless each cell is updated Lost in Excel Excel Discussion (Misc queries) 5 September 29th 08 06:56 PM
How do I insert a Timestamp when a cell changes? jgupte Excel Worksheet Functions 1 February 8th 08 03:06 AM
Timestamp And Store Cell Value franco Excel Programming 1 July 27th 06 05:14 PM
Need a 'last updated' timestamp for a web query [email protected] Excel Worksheet Functions 0 May 23rd 06 07:03 PM
How can a timestamp in an Excel row be automatically updated if a. dt Excel Worksheet Functions 1 April 12th 05 05:41 PM


All times are GMT +1. The time now is 11:17 PM.

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"