control tool checkbox and multiple functions

smhutch

New Member
Joined
Aug 13, 2009
Messages
18
I'm extremely new to macros and VBA for excel. With that said I'm excited about the functionality they can offer.

I have a complicated (for me) question to ask.

I have a workbook with 3 worksheets. One is labeled "main" and is being used as the main input source. The other two worksheets are hidden (they contain the forms that need completed depending on what checkbox is selected).

In the main worksheet I have columns A B C D and rows 1-6.

The first column is designated for data input (customer's name) and B, C, & D are for products a customer can select.

The rows are designated for Customer Name (data text input) and the columns designated for products. I have a check box in column B (not linked to cell) and when i click/check it, (because the product was selected) a macro unhides the sheet and if clicked on again/unchecked the sheet hides again.

Sub Checkbox1_Click()
Sheets("Product1").Visible = Not Sheets("Product1").Visible
End Sub

However, if I also place a check box below it for the next person, obviously the same code will do the opposite of what the first one did. (Click in the first one, check and it unhides. Click in the second check box and it hides again.)

I need to be able to Click/Check the first one and if I have to check another check box because the next person selects the same product, I need it to not change the visibility/unvisibility of the sheet.

The checkboxes need to remain independent of each other because one customer may not want what the other one wants, but each "click to checkmark" should validate if any of the other checkmarks are checked and if not unhide the sheet and if another one already is, simply bypass the hide sheet coding.

Much thanks
 

Excel Facts

How can you turn a range sideways?
Copy the range. Select a blank cell. Right-click, Paste Special, then choose Transpose.

Forum statistics

Threads
1,214,908
Messages
6,122,186
Members
449,071
Latest member
cdnMech

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