An implementation of Visual Basic that is built into Microsoft products.
Hello @LSTQE ,
Thanks for your question.
Your code looks fine, and the old values are still in the cells, so the issue might not be in the code. It may be that the Worksheet_Change event no longer runs. This could happen if Application.EnableEvents was left as False after a macro stopped partway through, if macros are disabled for the file, or if the file is opened in Excel for the web, which cannot run VBA macros.
I suggest checking these steps:
- Open the file in the Excel desktop app and make sure it is saved as .xlsm.
- If you see a yellow
Security Warningbar, clickEnable Content. If you see a redSecurity Riskbar, close the file, right-click it, selectProperties, checkUnblockon theGeneraltab, then open it again. - Press
Alt+F11, then pressCtrl+Gto open theImmediatewindow. Type the line below and press Enter:
?Application.EnableEvents
- If it shows False, type this line and press Enter:
Application.EnableEvents = True
- Make sure the code is in the module of the sheet that has the drop-down list, for example Sheet1. It should not be in Module1.
- Go back to the sheet and select a new option from the list.
You may also find these documents useful:
- Application.EnableEvents property
- Macros from the internet are blocked by default in Office
- Work with VBA macros in Excel for the web
Hope this helps! If my answer was helpful - kindly follow the instructions here so others with the same problem can benefit as well.