Forum Discussion

Andy Deane's avatar
Andy Deane
Copper Contributor
Mar 05, 2018
Solved

Linked Cell for Multiple ActiveX Check Boxes

I am trying to make a large to-do list using the ActiveX checkbox feature. I am able to get line to work the way I want but when I drag or copy the line to try and repeat it all of the checkboxes are...
  • Jamil's avatar
    Mar 05, 2018

    You can achieve what you have described using VBA.

    Below code can do the job.  this example links the ActiveX checkboxes to Column C. you can change the column C to whatever is your real data.

     

    I have also uploaded the sample file. when you run the macro, you will see what it does.

    Sub test()
    Dim sh As Shape
    N = 1
    For Each sh In ActiveSheet.Shapes
    If sh.Type = 12 Then   ' 12 is activex checkbox
    N = N + 1
    sh.OLEFormat.Object.LinkedCell = "C" & N  'change C to the column of cells to be linked
    End If
    Next sh
    End Sub
    

     

     

Resources