Constantly Check If There Is a Match to Execute a Macro

Important Notice


Please note that on 14th December 2023 users will experience an expected outage whilst we make upgrades to our network. We anticipate this process may take a couple of hours and so we apologise in advance for any inconvenience.

  • Hi all,


    I have this simple code that is acting in the background to check if the data validation list selection in Cell AB19 is "User Defined". It all basically formatting changes.


    Now this macro is only acting on Cell AB19 where this data validation list is. But I have 10 more different rows each having its own data validation list that will follow the same check.


    I am trying to transform this macro to act not only on Cell AB19 but also to act on the 10 other data validation lists on Rows 20 to Row 30 (AB20, AB21, AB22 etc.). I don't want to repeat this macro 10 times to check for each data validation.


    Is there a tidier way to adjust this macro. Or maybe any other suggested code.


    Any help is appreciated.


  • Maybe


  • Maybe


    Thanks for the input.


    I cant seem to make your code run as intended. I am a beginner VBA user, I just compile code i find over google haha.


    Actually now I'm thinking this approach wont work since the sheet will be locked and password protected.


    My understanding this code will constantly check if there is a match whenever anything on the sheet is modified. But if that's true I'm not sure how this will work with a password protected sheet since the code will do the format changes whether there is a match or not.

  • My code will check if specific cells are changed. With the information you provided that's all I can do. The selcet case needs extending to cover your other cells.


    If the sheet is protected then you need to unprotect it within the code, then protect it. Otherwise, you can protect withuserinterface only.


    Does it work on AB19?

  • My code will check if specific cells are changed. With the information you provided that's all I can do. The selcet case needs extending to cover your other cells.


    If the sheet is protected then you need to unprotect it within the code, then protect it. Otherwise, you can protect withuserinterface only.


    Does it work on AB19?

    Hello again,


    I removed the Case 20 part but the code wasn't making any changes based on AB19, I don't know why.


    Actually I changed the approach and made 10 drop down combo boxes and linked the references cell with a macro. Seems to work and I think less trouble than having a macro run in the background everytime someone makes any change.


    Thanks for your help Roy

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!