VBA confirm dialog box if in column F cell value is "Sanctioned" or "Rejected file"

  • Hello All,


    I am using a Excel file were we have drop down list as WIP, Sanctioned, Rejected file etc. what I am looking for is if user selects the option Sanctioned or Rejected from the drop down list in col F should get a pop up asking for confirmation with yes or no that he want to change the status to Sanctioned or Rejected.


    Because, if he selects Sanctioned or Rejected from the drop down list in col F another cell in Col P will change to Completed and entire row will be locked for editing.

  • Hello,


    Try this:


    Update the code where indicated, to do whatever you want when they select Yes/No

  • Hey Max, Thanks for your help and time. I would like to understand your code a little as I am still in learning stage. Hope you don't mind.


    The message box pop ups for all the following options [TABLE="border: 0, cellpadding: 0, cellspacing: 0"]

    [tr]


    [TD="width: 112"]Pending[/TD]

    [/tr]


    [tr]


    [td]

    Work in Progress

    [/td]


    [/tr]


    [tr]


    [td]

    Submitted

    [/td]


    [/tr]


    [tr]


    [td]

    Sanctioned

    [/td]


    [/tr]


    [tr]


    [td]

    Doubtful

    [/td]


    [/tr]


    [tr]


    [td]

    Rejected file

    [/td]


    [/tr]


    [/TABLE]
    The code should only pop up for Sanctioned or Rejected status only as on basis of this the entire row will be locked and can't be edited further unless the sheet is unprotected.

  • First you will need unlock the cells in the worksheet (re-lock any cells you would like to prevent people from editing):
    Select all cells in the worksheet (Cntrl + A) -> Right Click the Cells and click "Format Cells" -> Protection Tab -> Uncheck the "Locked" box.


    Then you can use this code. Anytime "Sanctioned" or "Rejected File" is selected in column F, and the user chooses yes on the input box, the entire row will be locked from editing:


    Please update the password in the code. It is currently "Password123"

Participate now!

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