June 26, 2016
Hello everyone, my name is Maurizio
and my problem is this:
On an excel sheet I inserted three CheckBoxes connected to three Different Cells. Which are: (A2); (A4); (A6) which simply have the function of writing in these cells (True; False)
Hora my question is this: There would be the possibility to Activate or Deactivate the Excel Function (Group).
I'll explain :
If in Cell (A2) - (A4) - (A6)
The word "True" appears in the procedure. The function (Group) should only be activated for the columns (B9: i15); (J9: P15); (Q9: W15)
The problem But that should be observed and that the cell "False" is reported in cell (A2) and I press the "Group Off" button it works well for me.
But it doesn't work with everyone else because.
(P.s) I offer you as always my test file
Thanks to all those who want to help me out
Greetings from A.Maurizio
December 20, 2019
are you saying the red button is not ungrouping?
I had a quick look at your code and i think there might be 2 problems.
1) you had the if then exit sub on 1 line, therefore the code was finding the first false and just exiting the code
2) you had the first line as on error goto finish, so any error would just exit the sub
Rather check if any cells are false to turn off the grouping could you just turn them all off as a default? if you use On Error Resume Next the code will continue until complete
Something like the below? this also unchecks all the check boxes
On Error Resume Next
Range("Tabella1[[Week 1]:[Week 7]]").Select
Range("Tabella1[[Week 8]:[Week 14]]").Select
Range("Tabella1[[Week 15]:[Week 21]]").Select
.Shapes("Check Box 3").ControlFormat.Value = False
.Shapes("Check Box 1").ControlFormat.Value = False
.Shapes("Check Box 2").ControlFormat.Value = False
On Error GoTo 0
June 26, 2016