View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default programming checkbox properties

ActiveSheet.OLEObjects.Add(ClassType:="Forms.Check Box.1",
Left:=ActiveCell.Left + ActiveCell.Width / 2 - 7,
Top:=ActiveCell.Top + ActiveCell.Height / 2 - 7,
Width:=14, Height _
:=14).Select
Selection.LinkedCell = ActiveCell.Address(external:=True)

--
Regards,
Tom Ogilvy


"mark" wrote in message
...
Hey.

I have a range of cells for which I would like to put a
checkbox in the center of each cell.

This works for creating the checkbox:

ActiveSheet.OLEObjects.Add(ClassType:="Forms.Check Box.1",
Left:=ActiveCell.Left + ActiveCell.Width / 2 - 7,
Top:=ActiveCell.Top + ActiveCell.Height / 2 - 7,
Width:=14, Height _
:=14).Select


What I need now is to link the checkbox to the cell that
it was just placed in.

I know it's using the .LinkedCell property, but I haven't
found what vb code will do it.

??
Thanks.