Clear cell contents derived from vlookup using VBA

Tom Donnelly 1 Reputation point
2022-09-06T23:30:27.087+00:00

I have created a list of 5 Categories in Column D that users can choose from. Depending on what the user selects in Column D, I have created dropdown lists (utilizing vlookup) in Column E that correspond to that. Now I want to code something that clears column E every time the content of the Cell in Column D changes. So if a user has selected "equipment" in column D and selected "HR" in column E, and then the user changes Column D to "Expenses", the contents of the adjacent cell in column E clears to blank, with the drop down based on the value of column D.

0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Oskar Shon 866 Reputation points MVP
    2022-11-09T21:42:40.62+00:00

    Try to understand that method based on INDIRECT formula:

    258858-xl-lista-poprawinoci-adres-posredni.png

    Or if you like VBA than try to set condition list every time you select something based on your rules in code
    (not based on range)

    258807-xl-lista-poprawnosci-musze-wypelnic.png

    0 comments No comments