PC Review


Reply
Thread Tools Rate Thread

checkbox linked to a cell

 
 
Greg
Guest
Posts: n/a
 
      8th Nov 2006
Hello,
I am programatically trying to add a checkbox.
but it looks like you have to give pixal locations

ActiveSheet.OLEObjects.Add(ClassType:="Forms.CheckBox.1", Link:=False, _
DisplayAsIcon:=False, Left:=111.75, Top:=197.25, Width:=85.5, Height
_
:=21.75).Select


is there a way to add a checkbox and give the cell row / column?


 
Reply With Quote
 
 
 
 
Dave Peterson
Guest
Posts: n/a
 
      8th Nov 2006
One way:

Option Explicit
Sub testme()

Dim myCell As Range
Dim OLEObj As OLEObject

Set myCell = ActiveSheet.Range("b3")

With myCell
Set OLEObj = .Parent.OLEObjects.Add(ClassType:="Forms.CheckBox.1", _
Link:=False, DisplayAsIcon:=False, _
Left:=.Left, Top:=.Top, Width:=.Width, Height:=.Height)
End With

End Sub



Greg wrote:
>
> Hello,
> I am programatically trying to add a checkbox.
> but it looks like you have to give pixal locations
>
> ActiveSheet.OLEObjects.Add(ClassType:="Forms.CheckBox.1", Link:=False, _
> DisplayAsIcon:=False, Left:=111.75, Top:=197.25, Width:=85.5, Height
> _
> :=21.75).Select
>
> is there a way to add a checkbox and give the cell row / column?


--

Dave Peterson
 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Checkbox linked to calcs MK Microsoft Excel Programming 0 1st Mar 2010 10:24 AM
3 option boxes to linked cell-linked cell to be 1,2,3. Paula Microsoft Excel Programming 1 29th Oct 2009 01:43 PM
CheckBox / Linked Cell Problem Joyce Microsoft Excel Programming 16 28th Sep 2009 01:47 PM
Checkbox name linked to a cell Tdp Microsoft Excel Misc 5 23rd Oct 2008 04:33 PM
checkbox linked to a cell Greg Microsoft Excel Discussion 1 8th Nov 2006 10:02 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 04:08 PM.