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 Programmatic addition of form elements relative to a cell

If you record a macro while you do it manually you get

ActiveSheet.OLEObjects.Add(ClassType:="Forms.Check Box.1", Link:=False, _
DisplayAsIcon:=False, Left:=377.25, Top:=114.75, Width:=78, Height:=
_
18.75).Select


so you could do
lTop = Range("B9").top
lLeft = Range("B9").Left
lWidth = Range("B9").Width
lHeight = Range("B9").Height
ActiveSheet.OLEObjects.Add ClassType:="Forms.CheckBox.1", _
Link:=False, DisplayAsIcon:=False, _
Left:=lLeft, Top:=lTop, Width:=lWidth, Height:=lHeight

--
Regards,
Tom Ogilvy




"Matt Jensen" wrote in message
...
Is it possible to programmatically add a form element to a worksheet where
do you can something along the lines of specifying it's location relative

to
a cell?
Thanks
Matt