Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel,microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default checkbox linked to a cell

Hello,
I am programatically trying to add a checkbox.
but it looks like you have to give pixal locations

ActiveSheet.OLEObjects.Add(ClassType:="Forms.Check Box.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?


  #2   Report Post  
Posted to microsoft.public.excel,microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default checkbox linked to a cell

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.Check Box.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
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
font color with checkbox linked cel Robbie Doo Excel Discussion (Misc queries) 0 January 28th 10 05:13 PM
Checkbox name linked to a cell Tdp Excel Discussion (Misc queries) 5 October 23rd 08 04:33 PM
I want to place a checkbox in the middle of a cell, yet I want thecheckboxArea take up the entire cell. Leonid L Excel Discussion (Misc queries) 2 July 30th 08 04:25 PM
How do I have a linked cell auto-size to fit the linked data? CristinPDX Excel Discussion (Misc queries) 0 June 24th 08 08:42 PM
checkbox on form reset from checkbox on sheet raw[_12_] Excel Programming 1 December 3rd 05 05:08 AM


All times are GMT +1. The time now is 04:05 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"