Hi - just delete module1. The code is an "event", so it is triggered by something happening in excel. The event name is:
Worksheet_Change
So, it is triggered by something on the worksheet changing.
Event macros need to go in the vba object module for what they need to apply to, so in this case, the sheet1 object. In the project explorer, you shoudl see two folders in your example, one for modules and one for microsoft excel objects. In the microsoft excel objects there will be a different module for each sheet, and one for the workbook. Open the module for sheet1 and copy the code into it.
The code will then run automatically whenever you change the worksheet, this part:
tells it only to run the rest of the code if the cell you changed is D1.
Bookmarks