Checkboxes selected based on Multiple selection criteria

Status
Not open for further replies.

SBNUT

New Member
Joined
Aug 25, 2021
Messages
33
Office Version
  1. 365
Platform
  1. Windows
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....

1632164812988.png
 

Excel Facts

Square and cube roots
The =SQRT(25) is a square root. For a cube root, use =125^(1/3). For a fourth root, use =625^(1/4).
Duplicate to: Check Checkboxes based on multiply criteria

In future, please do not post the same question multiple times. Per Forum Rules (#12), posts of a duplicate nature will be locked or deleted.

In relation to your question here, I have closed this thread so please continue in the linked thread. If you do not receive a response, you can "bump" it by replying to it yourself, though we advise you to wait 24 hours before doing so, and not to bump a thread more than once a day.
 
Upvote 0
Status
Not open for further replies.

Forum statistics

Threads
1,223,911
Messages
6,175,327
Members
452,635
Latest member
laura12345

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top