Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / New Users / November 2006

Tip: Looking for answers? Try searching our database.

checkbox linked to a cell

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Greg - 08 Nov 2006 21:14 GMT
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 - 08 Nov 2006 22:02 GMT
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

> Hello,
> I am programatically trying  to add a checkbox.
[quoted text clipped - 6 lines]
>
> is there a way to add a  checkbox and give the cell row / column?

Signature

Dave Peterson


Rate this thread:






 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.