View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
William[_2_] William[_2_] is offline
external usenet poster
 
Posts: 227
Default How to get the original data in a cell after it is modified

Hi Raghu

The following sub (insert in the relevant worksheet module) will record any
changes made to cell A1 and place the value prior to changing in column F
and the time it was changed in column G.

Private Sub Worksheet_Change(ByVal Target As Range)
Static vLast As Variant
If Target.Address = "$A$1" Then
If vLast < Target.Value Then
Range("F65000").End(xlUp).Offset(1, 1) = Now
Range("F65000").End(xlUp).Offset(1, 0) = vLast
vLast = Target.Value
End If
End If
End Sub

--
XL2002
Regards

William



"Raghunandan" wrote in message
...
| Hi All,
| I want to write a handler which will be called when the user changes the
| contents of a cell and I need to get the value in this cell before
| modification.Is there any way to do this?
|
| Thanks in advance
|
| Regards
| Raghu
|