I need a basic code for checkbox. On a form, when I create a checkbox, I'd like it to add (ex: +1 or -2, depending on the box) to a cell on the same sheet when checked, and add nothing when not checked. How to do this?
Perhaps I did this wrong. I placed the checkbox in Cell I8 and linked it to cell G81. I then entered the formula = I8 + (G81,1,0). Now when I check the box "TRUE" appears in G81 and when unchecked "FALSE". I wanted it to add numbers not show whether the box was actually checked. What am I doing wrong.
The formula =IF(G81,1,0) will return either 2 or 0 depending on if the checkbox is checked.
So, = A1 + IF(G81,1,0) will add either 1 or 0 to the value in A1.
Hence the question "Which numbers?"
The IF / checkbox part is done (unless you want to change 1,0 to 1,-2 which the OP implies)
All that's left is specifiying the other numbers.
(BTW, the checkbox is not in I8. It may be covering I8, but its not in the cell. Nor is it interfering with something being in the cell, beyond the issues of a)seeing what is in I8 and b)selecting I8 without clicking the checkbox. The location of a control on the sheet does not create any relationship between a cell and that control.)
I can't think of why all the checkboxes are reacting as one, unless all of them are linked to the same cell.
I'm new so sorry if these are dumb questions. The checkbox's are positioned over several cells in one column (one over each cell). What I'd like is to create a formula/code that when one box is checked, different numbers (+1, -2 or +3) is added to the sum of G81, G82, or G83. I linked each checkbox to G81, G82 or G83 with the formula in the "cell" reading something like =if(G81,2,0). Am I supposed to link the checkbox to the cell underneath it or to the cell I want the number added to?
THe Idea is that when each box is checked, some will be and some won't, that it adds a specifically assigned number to either box G81, G82, or G83. The check boxes are adjacent to questions on a form and in column J (One per each cell in the column all the way to J40). The form is divided into 3 sections. The first section needs to be totaled in Column G81, second in G82, etc. I do not want the number to appear anywhere else (if possible) other than being added to the G81, G82, etc. What do you think?