Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Copying checkboxes in Excel 2000

159 views
Skip to first unread message

Ken

unread,
Dec 27, 2002, 12:29:46 PM12/27/02
to
I want to create a series of checkboxes in rows and
columns and I want to be able to copy the cell links
incrementally.

IE - I want a checkbox on cell D20 to have D20 as its cell
link. I want to be able to copy that checkbox to cell D21
and have its cell link automatically jump to D21 (similar
to copying cells without the $ and having them change to
the new cell number)

Can this be done since checkboxes aren't a cell themselves?

Ken

unread,
Dec 27, 2002, 12:56:47 PM12/27/02
to
THANKS DEBRA!!! That's EXACTLY what I was looking for!!!
>-----Original Message-----
>AFAIK, you can't copy a checkbox to another cell and
automatically
>change the linked cell. You could use the following code,
written by
>Dave Peterson, to create a series of checkboxes:
>
>Sub loadCBX()
>
>Dim myCell As Range
>Dim myCBX As CheckBox
>Dim wks As Worksheet
>Dim rng As Range
>
>Set wks = ActiveSheet
>
>wks.CheckBoxes.Delete 'nice for testing!
>
>Set rng = wks.Range("D10:D25")
>
>For Each myCell In rng
> With myCell
> Set myCBX = ActiveSheet.CheckBoxes.Add _
> (Top:=.Top, Width:=.Width, _
> Height:=.Height, Left:=.Left)
> End With
> With myCBX
> .Name = "cbx_" & myCell.Address(0, 0)
> .LinkedCell = myCell.Address(external:=True)
> myCell.NumberFormat = ";;;"
> 'The linked cells are underneath the checkboxes
> 'and have a numberformat of ;;; so they look blank
> .Caption = "Active"
> End With
>
>Next myCell
>
>End Sub
>
>'The linked cells are underneath the checkboxes
>'and have a numberformat of ;;; so they look blank
>--
>Debra Dalgleish
>Excel FAQ, Tips & Book List
>http://www.contextures.com/tiptech.html
>
>.
>

Debra Dalgleish

unread,
Dec 27, 2002, 12:45:31 PM12/27/02
to

Sub loadCBX()

Set wks = ActiveSheet

wks.CheckBoxes.Delete 'nice for testing!

Next myCell

End Sub

0 new messages