This is what you need to do
Open the workbook and Hit ALT F11 - this will open the VB editor
Select the worksheet that contains the drop down validation list by double clicking the worksheet in the editor and copy and paste the code below into the editor
Then from the VB Editor menu at the top select Insert, then select Module. Copy your code into a module (making sure the Sub is called test as that is what the worksheet change event is calling i.e. it is calling the macro called test)
Close the editor and then try changing the value in D7 and your code should run if you have followed my instructions above.
Just looking at your code above you have not declared WS1 - I assume it is a worksheet - you should ensure that the variable is declared and initialised
You may have just posted a trimmed down version of your code however it is good practice to declare all variables
Bookmarks