ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Linked Check Boxes (https://www.excelbanter.com/excel-discussion-misc-queries/83847-linked-check-boxes.html)

blueegypt

Linked Check Boxes
 
I need to set up a Permissions or Security list and would like to use check
boxes.
The worksheet would have lets say 4 columns or 4 check boxes each pertaining
to a specific group. A B C & D
exp. If group A has permission the B C & D do.
If group C has persmission then D will but A & B will not.
I would like to check A and the rest will fall in but if I check C I only
want D to fall in and A & B will remain unchecked.
If you understand this at all please let me know your ideas or thoughts on
how this is achived.

mrice

Linked Check Boxes
 

Please try the attached.

It uses the calculate event to set the values of the other check
boxes.

Hope this helps.

Martin


+-------------------------------------------------------------------+
|Filename: Book1.zip |
|Download: http://www.excelforum.com/attachment.php?postid=4678 |
+-------------------------------------------------------------------+

--
mrice

Reserach Scientist with many years of spreadsheet development experience
------------------------------------------------------------------------
mrice's Profile: http://www.excelforum.com/member.php...o&userid=10931
View this thread: http://www.excelforum.com/showthread...hreadid=533928


blueegypt

Linked Check Boxes
 
Thank you so much, that is what I am looking for but I do not understand the
"calculate event". How do I get there?
I am not sure I am asking the right question.
I want to completely understand so I can add more options and groups but I
would not be able to right now unless I know how to create it myself.
Also..
I accidently clicked No when asked if this response helps, but it really
does. I hope I can fix that.

"mrice" wrote:


Please try the attached.

It uses the calculate event to set the values of the other check
boxes.

Hope this helps.

Martin


+-------------------------------------------------------------------+
|Filename: Book1.zip |
|Download: http://www.excelforum.com/attachment.php?postid=4678 |
+-------------------------------------------------------------------+

--
mrice

Reserach Scientist with many years of spreadsheet development experience
------------------------------------------------------------------------
mrice's Profile: http://www.excelforum.com/member.php...o&userid=10931
View this thread: http://www.excelforum.com/showthread...hreadid=533928



blueegypt

Linked Check Boxes
 
Martin -
I figured out what that ment and how to work with it.
I now have the problem of entering more then one line of selections.
How do you enter the code in order to keep each selection group seperate?
How do you end a group and start a new?
I may need to learn a lot more about visual basics.
Thank you
Amy

"blueegypt" wrote:

Thank you so much, that is what I am looking for but I do not understand the
"calculate event". How do I get there?
I am not sure I am asking the right question.
I want to completely understand so I can add more options and groups but I
would not be able to right now unless I know how to create it myself.
Also..
I accidently clicked No when asked if this response helps, but it really
does. I hope I can fix that.

"mrice" wrote:


Please try the attached.

It uses the calculate event to set the values of the other check
boxes.

Hope this helps.

Martin


+-------------------------------------------------------------------+
|Filename: Book1.zip |
|Download: http://www.excelforum.com/attachment.php?postid=4678 |
+-------------------------------------------------------------------+

--
mrice

Reserach Scientist with many years of spreadsheet development experience
------------------------------------------------------------------------
mrice's Profile: http://www.excelforum.com/member.php...o&userid=10931
View this thread: http://www.excelforum.com/showthread...hreadid=533928



mrice

Linked Check Boxes
 

To keep groups separate, you need to duplicate the code with the same
macro using (say) C5- C8 and opposed to C1-C4. There is only one
worksheet_calculate event to play with.

Dim Calculating As Boolean


Private Sub Worksheet_Calculate()
If Calculating = True Then Exit Sub


If Range("C1").Value = True Then
Calculating = True
Range("C2") = True
Range("C3") = True
Range("C4") = True
Calculating = False
Exit Sub
End If

If Range("C2").Value = True Then
Calculating = True
Range("C3") = True
Range("C4") = True
Calculating = False
Exit Sub
End If

If Range("C3").Value = True Then
Calculating = True
Range("C4") = True
Calculating = False
Exit Sub
End If

'second block

If Range("C5").Value = True Then
Calculating = True
Range("C6") = True
Range("C7") = True
Range("C8") = True
Calculating = False
Exit Sub
End If

If Range("C6").Value = True Then
Calculating = True
Range("C7") = True
Range("C8") = True
Calculating = False
Exit Sub
End If

If Range("C7").Value = True Then
Calculating = True
Range("C8") = True
Calculating = False
Exit Sub
End If

'further blocks go here

End Sub


Don't worry about clicking the No button - :) :)


--
mrice

Research Scientist with many years of spreadsheet development experience
------------------------------------------------------------------------
mrice's Profile: http://www.excelforum.com/member.php...o&userid=10931
View this thread: http://www.excelforum.com/showthread...hreadid=533928



All times are GMT +1. The time now is 12:03 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com