Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
check boxes
I need to set-up some check boxes or option boxes and need to have two
funtionalities. I do not have any knowledge on this, so if you can help, please be as descriptive as possible. (1) will have two columns with a check box in each for every row, where users can select one of the two options. I need it to be set-up to where if you select the option in column E, you can't select the one in column F - only one or the other. (2) I need to set-up a select all for each column (E & F) so that if someone wants to select all the options in column E, they can click the box and all the boxes below in column E are automatically checked/clicked. THanks. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
check boxes
Can anyone help? Thanks!
" wrote: I need to set-up some check boxes or option boxes and need to have two funtionalities. I do not have any knowledge on this, so if you can help, please be as descriptive as possible. (1) will have two columns with a check box in each for every row, where users can select one of the two options. I need it to be set-up to where if you select the option in column E, you can't select the one in column F - only one or the other. (2) I need to set-up a select all for each column (E & F) so that if someone wants to select all the options in column E, they can click the box and all the boxes below in column E are automatically checked/clicked. THanks. |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
check boxes
I wouldn't use checkboxes for this kind of thing. I'd use optionbuttons. If
those optionbuttons are grouped correctly, then only one of the buttons can be selected at any time. You don't have to do anything special. If you want to try this... Option Explicit Sub SetupOneTimeOnly() Dim GrpBox As GroupBox Dim OptBtn As OptionButton Dim myRng As Range Dim myCell As Range Dim wks As Worksheet Dim iCtr As Long Dim maxBtns As Long Set wks = Worksheets("Sheet1") maxBtns = 2 With wks 'clean up existing junk .GroupBoxes.Delete .OptionButtons.Delete Set myRng = .Range("e2:E20") 'left most column only For Each myCell In myRng.Cells With myCell.Resize(1, maxBtns) Set GrpBox = wks.GroupBoxes.Add _ (Top:=.Top, Left:=.Left, _ Height:=.Height, Width:=.Width) With GrpBox .Caption = "" .Visible = True 'False If myCell.Row = myRng.Cells(1).Row Then .Name = "GRP_Parent_" & myCell.Address(0, 0) Else .Name = "GRP_Child_" & myCell.Address(0, 0) End If End With End With For iCtr = 0 To maxBtns - 1 With myCell.Offset(0, iCtr) Set OptBtn = wks.OptionButtons.Add _ (Top:=.Top, Left:=.Left, _ Height:=.Height, Width:=.Width) OptBtn.Caption = "" OptBtn.Name = "OPT_" & Format(iCtr, "00") _ & "_" & myCell.Address(0, 0) If iCtr = 0 Then With myCell.Offset(0, -2) OptBtn.LinkedCell = .Address(external:=True) End With End If If myCell.Row = myRng.Cells(1).Row Then OptBtn.OnAction _ = "'" & ThisWorkbook.Name & "'!ChangeAllBtns" End If End With Next iCtr Next myCell End With End Sub Sub ChangeAllBtns() Dim MstrBtn As OptionButton Dim OptBtn As OptionButton Set MstrBtn = ActiveSheet.OptionButtons(Application.Caller) For Each OptBtn In ActiveSheet.OptionButtons If LCase(OptBtn.GroupBox.Name) Like LCase("GRP_Child*") Then If LCase(Left(OptBtn.Name, 6)) Like _ LCase(Left(MstrBtn.Name, 6)) Then OptBtn.Value = xlOn End If End If Next OptBtn End Sub I filled in E2:F20 with optionbuttons. A lot of this code was taken from Debra Dalgleish's site: http://www.contextures.com/xlForm01.html You may want to review that, too. wrote: I need to set-up some check boxes or option boxes and need to have two funtionalities. I do not have any knowledge on this, so if you can help, please be as descriptive as possible. (1) will have two columns with a check box in each for every row, where users can select one of the two options. I need it to be set-up to where if you select the option in column E, you can't select the one in column F - only one or the other. (2) I need to set-up a select all for each column (E & F) so that if someone wants to select all the options in column E, they can click the box and all the boxes below in column E are automatically checked/clicked. THanks. -- Dave Peterson |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Copy and move check box (check boxes) with new cell link? | Excel Worksheet Functions | |||
How do I increase the size of check in check boxes | Excel Discussion (Misc queries) | |||
Enable check box in protected sheet + group check boxes | Excel Discussion (Misc queries) | |||
How do i create a value for check boxes or option boxes | Excel Discussion (Misc queries) | |||
Check Box influencing other Check Boxes | Excel Programming |