Home |
Search |
Today's Posts |
#2
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
This cannot be done accurately with any built in functions or data. There is
a document property that tells when the entire file was last modified, but that may not be the same as when the data on Sheet1 was added to it. More than likely it will be the last time you either closed or re-opened it. You could do this with code attached to Sheet1's worksheet _Change event to put the date/time that a change was made somewhere on that sheet or elsewhere in the workbook, but if you want details of changes for several cells, then it takes one storage location for each cell you want to track changes for. The code below tracks the change/value in one single cell on Sheet1. Let's say you want to watch/test for changes in cell A5 on Sheet1, and you want the date to appear/not appear in B5 on another sheet (Sheet2) then you could put code like this in the worksheet's _Change event: Private Sub Worksheet_Change(ByVal Target As Range) Dim iSect As Range Set iSect = Application.Intersect(Range(Target.Address), Range("A5")) If Application.Intersect(Range(Target.Address), Range("A5")) Is Nothing Then Exit Sub End If If Range(Target.Address) 0 Then Sheets("Sheet2").Range("B5") = Now() ' save altered date/time Else Sheets("Sheet2").Range("B5") = "" ' clear it out End If End Sub To enter this code into the proper place for it to work with sheet 1, right-click on the sheet's name tab and choose View Code. Then cut this code and paste it into the page that appeared. Change the sheet names and cell references as needed for your real world use. "Angel" wrote: my question is example that if from sheet 1 i want to get value( numer) data if 0 display to another sheet the date when was insert Regards Thanks for the help! |