Hi IR,
You can use the Worksheet_Change event in VBA to accomplish this task. Right-click the worksheet tab for which you want this code to run, then choose View Code.
In the VBA editor window, paste the following code then close the editor window:
Try it out!
Note: The EnableEvents lines prevent an infinite loop since changing the value of the target cell would continuously call the change event. The error handling was added so that if you have a non-numeric value in H1 it won't crash the macro and leave events disabled - which would stop all future macros from running until you re-enabled them.
Bookmarks