Forum Discussion

Rashaud35's avatar
Rashaud35
Copper Contributor
Nov 18, 2022
Solved

VBA to output Product of two cells if checkbox is "Checked" but stay a zero value if "Unchecked"

Hello. I've placed some checkboxes into my Excel spreadsheet and would like to apply a Macro to it that will do the following:   If checkbox is CHECKED and linked to cell E7 in format control, then...
  • mtarler's avatar
    mtarler
    Nov 19, 2022

    Rashaud35  it doesn't matter where the checkbox is located.  you want to link to some 'other' cell and not the one you want the formula in.  so in the attached I changed the 1st row to be 'linked' to D7 so in E7 is the formula =B7*C7*D7

    You can then "hide" the true/false text by changing the font color to be same as fill color (you could also use custom number formatting if needed)

     

Resources