fill down populates rows with check boxes, with same link cell

lalbatros

Well-known Member
Joined
Sep 5, 2007
Messages
659
Hello,

I created a checkbox that fits within the cell it is linked to.
By filling down the link-cell, I can multiply the number of check box.
This is almost what I wanted to do: create check boxes by simply filling down.

However, the link cell remains the same.
This is not what I would like to do.
I would like a new check box to be linked to the new cell where it fit in.
In that way, I could have the check box working exactly as it would in an Access form, for example.

Would there be a way to do that?
Without this possibility, I would rather use a simple "x" mark in a cell for the same purpose.

Thanks,

Michel
 

Excel Facts

Fastest way to copy a worksheet?
Hold down the Ctrl key while dragging tab for Sheet1 to the right. Excel will make a copy of the worksheet.
Rather than copying & pasting, you could use some macro code to insert the checkboxes. The following code will insert checkboxes into A1:A10, name them, resize them to fit the cell, set up the linked cells and change the caption.

Code:
Sub insertCheckboxes()
    For x = 1 To 10
        Set c = Cells(x, "A")
        n = "Choice_" & Format(x, "00")
        m = "My Check Box " & Format(x, "00")
        With ActiveSheet.OLEObjects.Add( _
            ClassType:="Forms.CheckBox.1", _
            Link:=False, _
            DisplayAsIcon:=False, _
            Left:=c.Left, _
            Top:=c.Top, _
            Width:=c.Width, _
            Height:=c.Height)
            .Name = n
            .LinkedCell = c.Address
            .Object.Caption = m
        End With
        ActiveSheet.Shapes(n).Placement = xlMoveAndSize
        c.Value = False
    Next x
End Sub
Thanks to Rorya who helped out with this code
 
Upvote 0
Hello,

what if i want to insert the tick boxes in the column conditional of cell in another column not to be empty- so basically I am working on a model and I want to insert tickboxes in column N10 to N21279 only if the correspondant cell in J column has value.

the same goes for column O10 to O21279 till V10 to V21279

Looking forward to your feedback!!

Thanks
Reem


Rather than copying & pasting, you could use some macro code to insert the checkboxes. The following code will insert checkboxes into A1:A10, name them, resize them to fit the cell, set up the linked cells and change the caption.

Code:
Sub insertCheckboxes()
    For x = 1 To 10
        Set c = Cells(x, "A")
        n = "Choice_" & Format(x, "00")
        m = "My Check Box " & Format(x, "00")
        With ActiveSheet.OLEObjects.Add( _
            ClassType:="Forms.CheckBox.1", _
            Link:=False, _
            DisplayAsIcon:=False, _
            Left:=c.Left, _
            Top:=c.Top, _
            Width:=c.Width, _
            Height:=c.Height)
            .Name = n
            .LinkedCell = c.Address
            .Object.Caption = m
        End With
        ActiveSheet.Shapes(n).Placement = xlMoveAndSize
        c.Value = False
    Next x
End Sub
Thanks to Rorya who helped out with this code
 
Upvote 0

Forum statistics

Threads
1,224,586
Messages
6,179,723
Members
452,939
Latest member
WCrawford

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top