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
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
Sub Ripristina2()
On Error Resume Next
Range("Tabella1[[Week 1]:[Week 7]]").Select
Foglio1.Range("C9:I15").Select
Selection.Columns.Ungroup
Range("Tabella1[[Week 8]:[Week 14]]").Select
Foglio1.Range("J9:P15").Select
Selection.Columns.Ungroup
Range("Tabella1[[Week 15]:[Week 21]]").Select
Foglio1.Range("Q9:W15").Select
Selection.Columns.Ungroup
With ActiveSheet
.Shapes("Check Box 3").ControlFormat.Value = False
.Shapes("Check Box 1").ControlFormat.Value = False
.Shapes("Check Box 2").ControlFormat.Value = False
End With
'Foglio1.Range("A1").Select
On Error GoTo 0
End Sub
Hi Purfleet
Thank's for your job
Surely without you, I would never have been able to solve it, because it's all yesterday that I tried and tried again but without solving anything.
Now it works wonderfully
Greetings and thanks once again from A.Maurizio