select cell and have content in another cell changed

  • Hello everyone. First of all I hope you are all safe and well with what is going on now in the world.
    I have a request, anyone can help me build a code to do the below?

    Anytime I click on a cell of range D6:H26 and the content of the cell is either Blank or a "?" (note: all cells have an IF formula, and the possible results are 1) blank 2) ? 3) V 4) X )

    a simple form comes up and allows me to:

    Title of the form, should be string that concatentates value from correspondent column, row 5 and column B, correspondent row

    Option 1
    Click on a green V

    Option 2
    Click on a red X

    Option 3
    Close the form.

    Consider that range D6:H26 is basically a chart, with fixed headers in row 5 and fixed values in column B. (column C is not relevant)

    So let's say that I click on cell E9:

    A form comes up. I click on the "V".

    Now what I need is that I get a Msgbox to read "Do you want to assign [value from $B9] to [value from E$5]?

    Then a simple yes and no. With No to be the pre-selected one.

    If Yes is selected then E9 remains as is, but the code changes the value of CQ9 to V.

    So basically, it's the correspondent cell in range CP6:CT26 that changes the value according to my selection (so same row # but column + 90). This range is hidden.

    If I click on the "X" instead, the Msgbox has to read "Do you want to exclude [value from $B9] from [value from E$5]?
    If Yes is selected then the code changes the value of CQ9 to X.

    I am pretty sure it's quite simple but I get lost with the form and the references. So I'd rather learn from any of you.

    Thank you in advance! If something of the above is unclear do let me know

  • Here attached.

    These are the charts, with the exact cell positions.

    I also created the userform in the VBA.

    I've highlighted cell E9 as per my example. So if I click on a cell, where it's blank or a ? then the userform comes out and based on the selection it first shows the MsgBox and then adds V or X accordingly into CQ9.

    Hope it makes sense now?

    and thank you!

Participate now!

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