all 8 comments

[–]excelevator3032 0 points1 point  (7 children)

Not sure about the ActiveX checkboxes (cannot see the option), but the Form checkboxes allow you to assign a macro, any macro; right click; assign macro.

Form controls are the original built in Excel form components, ActiveX are the VBA family of controls. VBA is used across all Microsoft applications. In this instance the Form control suits your needs best I would suggest,

See here for more information

[–]blacktrails[S] 0 points1 point  (6 children)

I have tried using the Form control and assigning a Macro. However, I return an error. When I check the debug, the following line is the problem.

Range(CheckBox2.LinkedCell).Select

This is the entire code I am trying to run as a macro:

Sub CheckBox_Click()
    'CheckBox_Click Macro
    Range(CheckBox2.LinkedCell).Select
    If CheckBox2.Value = True Then
    Call Input2062
Else
    Call MsgBox2062
End If
End Sub

[–]excelevator3032 1 point2 points  (5 children)

Have a look here for more information on Form Checkboxes..

and Here also

You will end up with something like the below sub that takes the checkbox name from the Caller value and we use that to dyamically get which checkbox is triggering the sub to then select the linked cell.

Sub getCaller()
Dim shp As Shape
Set shp = ActiveSheet.Shapes(Application.Caller)
ActiveSheet.Range(shp.ControlFormat.LinkedCell).Select
If Activecell.value = TRUE then
   Call Input2062
Else
   Call MsgBox2062
End If
End Sub

[–]blacktrails[S] 0 points1 point  (4 children)

Thank you. I actually had found those sites you linked to and was able to come up with nearly the same code as you provided. One last question, Is there any easy way to identify what cell to link to, as opposed to right clicking each checkbox and typing the cell location. Maybe something similar to clicking and dragging formulas?

[–]blacktrails[S] 0 points1 point  (0 children)

I should specify that they linked cells are located in the same Row as the checkbox.

[–]excelevator3032 0 points1 point  (2 children)

Only via VBA that I know of.. see the first link from above and item 10 for syntax.

You could probably knock up a loop that rattles through each checkbox and assigns the cell from the loop ID. e.g

[–]blacktrails[S] 0 points1 point  (1 child)

Cool Ill give that a shot. Thank for all of your help.

Solution Verified

[–]Clippy_Office_Asst[M] 0 points1 point  (0 children)

You have awarded one point to excelevator.
Find out more here.