*** Warning Following example fails, but may give a good idea on how to do
it ***
Look at the following code that I wrote, attached to a worksheet:
Private Sub Worksheet_Change(ByVal Target As Excel.Range)
MsgBox "change"
End Sub
Private Sub Worksheet_SelectionChange(ByVal Target As Excel.Range)
MsgBox "selection_change"
End Sub
The above shows events you can attach to the worksheet. Then each time you
move the
cursor in the worksheet in question, 'SelectionChange' fires. You could use
that event to
copy the value of the selection into a global.
Public Oldval As Variant
Public oldaddr As Variant
Private Sub Worksheet_Change(ByVal Target As Excel.Range)
If Not ActiveSheet.Name = "log" Then
Sheets("log").Select
Range("'log'!A1").End(xlDown).Offset(1, 0).Value = oldaddr
Range("'log'!A1").End(xlDown).Offset(1, 1).Value = Oldval
Range("'log'!A1").End(xlDown).Offset(1, 2).Value =
Range(oldaddr).Value
Sheets(1).Select
End If
End Sub
Private Sub Worksheet_SelectionChange(ByVal Target As Excel.Range)
Oldval = ActiveCell.Value
oldaddr = ActiveCell.Address
End Sub
The above code failes. Perhaps excel is too confused by trying to change
the
sheet before the event is done fireing. I don't know. But if you instead
of writing
changes to the 'log' sheet, if you used a flat file (opened with the open
statement)
you may have more success. You could then review the data in notepad or
bring
it into a spreadsheet.
"Caroline B" <Caroline
wrote in message
...
Is there a quick way to track/log changes made in a cell - there is an
add-in
that calculates values (you can see the values in this cell) to produce
other
values. I want to be able to list the values (as seen in this cell) -
they
aren't logged or shown anywhere else by this add-in and are over written
too
quickly to be noted down manually.