I have a Job worksheet that has several hundred lines in it for different aspects of a job. When we are bidding a job, my employees go through the list and selects which lines are needed to complete the job. A job could consist of one line, or several hundred lines. I have several checkboxes in this worksheet to control if a discount is taken, if sales tax is calculated on the chosen line, etc. that are in multiple columns of the sheet. I also have a master checkbox for Discount in the header section of the worksheet (cell Z11). If this box is checked, and if the discount checkbox on the individual line is checked, the discount is calculated for that line. This is all working fine. However, the employees have to individually select each discount checkbox in each line of the job. I would like to write some VBA code that would run when the master discount checkbox is checked to select the individual discount checkbox in a line if 1) the master checkbox in cell z11 was true, and 2) if the value in cell G plus the individual line number is greater than $0. Let me try and say that a little different. If the master checkbox in Z11 is "True", then loop through each row starting with row 8 and check if the value in column g of that row is greater than $0, if so, mark the discount checkbox in column "P" for that row. If not, leave that rows Discount checkbox blank.
All job line items start in row 8 and go through row 650 (rows 1 -7 has header information about the job). All the checkboxes are Form Control checkboxes that are in column "P" and are currently sequentially numbered starting with Checkbox474 and ending with Checkbox824 (If I add additional rows in the future, then the checkbox number will not be sequential. One option would be to name all the checkboxes so the number didn't matter) I could do this very easy with and IF/And statement in the cell the checkbox is linked to. However, if the employee "Un-Checks" the checkbox, it wipes out the formula. So I was thinking that VBA would be the way to go. At each change in the master checkbox, VBA code could check and mark the appropriate lines. I know just enough about VBA to be dangerous, so this is a little about my ability without some help. Thanks in advance for the help....
All job line items start in row 8 and go through row 650 (rows 1 -7 has header information about the job). All the checkboxes are Form Control checkboxes that are in column "P" and are currently sequentially numbered starting with Checkbox474 and ending with Checkbox824 (If I add additional rows in the future, then the checkbox number will not be sequential. One option would be to name all the checkboxes so the number didn't matter) I could do this very easy with and IF/And statement in the cell the checkbox is linked to. However, if the employee "Un-Checks" the checkbox, it wipes out the formula. So I was thinking that VBA would be the way to go. At each change in the master checkbox, VBA code could check and mark the appropriate lines. I know just enough about VBA to be dangerous, so this is a little about my ability without some help. Thanks in advance for the help....