ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Where to place code that changes a cell value? (https://www.excelbanter.com/excel-programming/353726-where-place-code-changes-cell-value.html)

George Furnell[_2_]

Where to place code that changes a cell value?
 
I would like the code to execute if the value of any cell changes, but I do
not want to copy the code to more than one location. I.E only one place to
update the code if maintenance is needed.

Regards
George


Patrick Molloy[_2_]

Where to place code that changes a cell value?
 
1) from the subject line: code that changes a cell's value ouight to be
written in a standard module. It could really go into other places, but "good
practice" would be a standard code module

2) the cell changed event can be trapped in a worksheet's code pade- this
fires when a cell's value is changed by entering a new value, NOT when a
value changes as a result of a calculation. The quick way to get to a sheet's
code page is to rioght click the tab and select the last item of th epop-up
menu.



"George Furnell" wrote:

I would like the code to execute if the value of any cell changes, but I do
not want to copy the code to more than one location. I.E only one place to
update the code if maintenance is needed.

Regards
George



All times are GMT +1. The time now is 12:14 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com