Save value of cell prior to change

R

Rick

is there any way to save the value of a cell into another cell if the cell is
updated?

If A1 has a date (01/01/09) and that date changes (02/01/09)I want to save
the previous value (01/01/09) in K1.

This repeats on 4 cells within the row and multiple rows.

thanks,
Rick
 
B

Bob Umlas

Tight-click the sheet tab, select view Code, paste this in:

Dim WasValue

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Column = 1 Then Cells(Target.Row, 11).Value = WasValue
End Sub

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Target.Column = 1 Then WasValue = Target.Value
End Sub


Bob Umlas
Excel MVP
 
B

Bob Umlas

Make that Right-click, not Tight-click
:)


Bob Umlas said:
Tight-click the sheet tab, select view Code, paste this in:

Dim WasValue

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Column = 1 Then Cells(Target.Row, 11).Value = WasValue
End Sub

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Target.Column = 1 Then WasValue = Target.Value
End Sub


Bob Umlas
Excel MVP
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top