Archive of cells


Posted by Andrew Wild on January 06, 2002 2:46 PM

How do I archive the data in a cell and how is this data retrived for use elsewhere in the sheet at a later time?



Posted by Derek on January 06, 2002 9:23 PM

Hi Andrew,
This worksheet macro will add each entry you make in Cell A1 to a list in Column H , with a negative number against it in Column G. You can use the Vlookup formula on the negative number in G to reference the archived entry in H. eg vlookup(-25,G:H,2)
Don't use Columns G & H (or your column selection) for any other purpose/data.
Hope this helps you
Derek

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address = "$A$1" Then
If Range("A1").Value > "" Then
Range("G1:H1").Select
Selection.Insert Shift:=xlDown
Range("H1").Value = Range("A1").Value
Range("G1").Value = Range("G2").Value - 1
Range("A1").Select
End If
End If
End Sub