Exploring The Limits of Excel by Caballero Eloy

Exploring The Limits of Excel by Caballero Eloy

Author:Caballero, Eloy
Language: eng
Format: epub
Publisher: UNKNOWN
Published: 2016-12-12T16:00:00+00:00


Figure 72: This is the subroutine inserted in Module 1

Notice the importance of using the worksheet events ChangeandSelectionChange at the proper place, one to capture the introduced value and the other one to store the previous value. Also, when theretroDataVal macro is called, it is necessary to suspend temporarily all events in the application.

Application.EnableEvents = False

This is indispensable if we want to prevent a loop trap to be triggered by the statement cell.value, which is equivalent to editing a cell and would then activatetheChange event in the worksheet, thereby creating an infinite loop.

For Each cell In Range("myValidation").Cells

If cell.Value = past Then cell.Value = present

Next cell

Once the editing process has been done, application events have to be enabled again(True) in order for the utility to work properly. Now suppose there is a change in the original sourcemyList and Madrid converts in Barcelona. This is what happens:



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.