Forum Discussion

Andrew_Hinson's avatar
Andrew_Hinson
Brass Contributor
Dec 10, 2022

Checkboxes

Hi all,

 

I have inserted a checkbox into a cell and am trying to drag it down a few hundred cells using the autofill function. However, when I drag it down the checkbox it will not autofill into the cells. It just drags down nothing?

 

Autofill is working fine because if I put a number 1 and 2 in the cells and drag them down, it autofills as it should 1, 2, 3, 4 etc...

 

Any thoughts Excel legends?

Thank you.

  • NikolinoDE's avatar
    NikolinoDE
    Gold Contributor

    Andrew_Hinson 

    It's always difficult with checkboxes... As far as I know, this only works with VBA.

    The how, however, depends on whether all the checkboxes are already in place and you just want to adjust the cell linking, or whether the checkboxes have yet to be created.

     

    Sub CheckBox()
         Dim chkElement As CheckBox
         For Each chkElement In ActiveSheet.CheckBoxes
             chkElement.LinkedCell = chkElement.TopLeftCell.Address
         Next chkElement
    end sub

     

     Note: if the check box is not exactly on (or a little below) the upper edge and exactly on (or a little to the right of) the left edge of the desired cell, it may happen that another cell is entered as the cell link. Excel can't know exactly which cell you want to link and you have to define a criterion - in this specific case the upper left corner.

     

    Hope I was able to help you with this info.

     

    NikolinoDE

    I know I don't know anything (Socrates)

    • Andrew_Hinson's avatar
      Andrew_Hinson
      Brass Contributor
      Hi @NikolinoeDE - I am a bit confused by your response, I am not an expert with Excel at all!

      I want to put a checkbox in a cell (let's say B2) and then grab the lower right hand corner of B2 to drag it down by let's say 200 cells, therefore putting that checkbox in cell B3, B4. B5 etc etc).

      Hope this is clearer?
      • NikolinoDE's avatar
        NikolinoDE
        Gold Contributor

        Andrew_Hinson 

        Maybe this guide will help you where you can just drag down the cell with the check box with the mouse... it's probably the way you see in many videos.

         

        How to insert multiple checkboxes

        In Excel, Fill Handle is a function to do many things. It can also fill the checkboxes. First, you need to insert a check box.

         

        Proceed as follows:

        1. Click Developer on the menu bar, click Insert, and check the box under Form Control.

        Note to 1:

        The Developer tab isn't displayed by default, but you can add it to the ribbon.

        On the File tab, go to Options -> Customize Ribbon.

        Under Customize the Ribbon and under Main Tabs, select the Developer check box.

        2. Click on the check box and you will see a plus sign pointer.

        Click where you want to add the check box.

        3. Select the check box (Form Control), move it to a cell and clear the check box name.

        4. Then select the cell where the check box is located. Then use your mouse to drag the cell down over the range of cells you want to fill.

        Thus you have check boxes in the desired cells.

         

        *Attached is a file where you can simply drag down the cells of the check box with the mouse.

         

        Hope that helped...if not, please just ignore.

         

        NikolinoDE

        I know I don't know anything (Socrates)

Resources