P
Paolo De Laurentiis
I'm trying to rewrite a sort of the "track changes" feature of Excel using
VBA.
The method I'm following is to store in a variable the value of the active
cell/range every time the application event "selection change" is triggered.
Then, we a change happens ("sheet change" event is triggered) I compare the
new value with the previously stored variable.
This works fine when the user changes cells using "normal" methods like just
writing into
a cell or copying and pasting.
However, it doesn't work when using the autofill method: dragging
(or double clicking) the small dot at bottom right corner of the selection
marker.
In this case the "change" event is triggered BEFORE the "selection change"
event, and not after as in "normal" methods.
So in this case the application cannot store the values/formulas the cells
had before they were changed, thus I can't compare changes.
That's the SheetChange event declaration I'm using. Maybe I'm missing
somthing?
Private Sub App_SheetChange(ByVal Sh As Object, ByVal Target As Range)
I wonder whether there's a complete different way for doing that, like
having a method of the range object that is passed to the "Sheet Change"
event
that stores the value/formula the range had before the change.
Do you have any idea for solving the above issue?
Many thanks for your help.
Paolo
Milan, Italy
VBA.
The method I'm following is to store in a variable the value of the active
cell/range every time the application event "selection change" is triggered.
Then, we a change happens ("sheet change" event is triggered) I compare the
new value with the previously stored variable.
This works fine when the user changes cells using "normal" methods like just
writing into
a cell or copying and pasting.
However, it doesn't work when using the autofill method: dragging
(or double clicking) the small dot at bottom right corner of the selection
marker.
In this case the "change" event is triggered BEFORE the "selection change"
event, and not after as in "normal" methods.
So in this case the application cannot store the values/formulas the cells
had before they were changed, thus I can't compare changes.
That's the SheetChange event declaration I'm using. Maybe I'm missing
somthing?
Private Sub App_SheetChange(ByVal Sh As Object, ByVal Target As Range)
I wonder whether there's a complete different way for doing that, like
having a method of the range object that is passed to the "Sheet Change"
event
that stores the value/formula the range had before the change.
Do you have any idea for solving the above issue?
Many thanks for your help.
Paolo
Milan, Italy