Yes No Popup box depending on cell values

  • Hello. I am new to VBA. I have looked and looked and tried to use Excel Help from Microsoft, but can't seem to get something to work.

    I want to have a message box pop up with yes and no questions once a cell has a value on it. But once that value is entered, I would like it to look at previous cells to see what code to run to unhide rows. I had a macro set up to unhide rows based on a button the user would click, but I would like to have a box pop up and have the user select Yes to run macro instead of user selecting it. But depending on a previous cell, it could run a different macro.

    here is a snippet of my code:

    Where UnhideinfoEXP is the macro that basically unhides row 60 and 48-52. This coding works, except when I click No, it still runs the macro.

    Also, if the answer is to the pop up is Yes, I would like it to look at cell 44 to see if it says DEP, and if so to also to unhide row 67, if not only unhide those listed.

    I guess I can start with the yes and no button to decide if things should be hidden or not, but I am not familar with changing a popup message to have Yes/No and have the Yes result action depend on a different cell value as what action to unhide while the NO action would basically hide rows 80-90

    Please bare with me as I can not post my workbook to the forum, and if I am unclear, I am also sorry.


  • Re: Yes No Popup box depending on cell values

    This is off the top of my head and not tested. Also I have only addressed the issue of macro running when no is clicked.

Participate now!

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