Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Setting LinkedCell on a CheckBox Control

Excel XP SP2
I need to set the LinkedCell property on a control with VB, both fo
optionbuttons and checkboxes, but I cannot find a way to access th
property in VB (I also want to set the GroupName and Caption, bu
assume the answer would be similar).

I'm able to set the name (height, width, top, left, etc) with (e.g.):

ActiveWorkbook.Worksheets("Sheet1").Shapes("CheckB ox1").Name
"Checkbox1Name"

but not the other three properties mentioned above.

These controls are on a worksheet and not a form, the Help system ha
let me down.

-s

--
Message posted from http://www.ExcelForum.com

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Setting LinkedCell on a CheckBox Control

With ActiveWorkbook.Worksheets("Sheet1").OleObjects("Ch eckBox1")
.Name = "Checkbox1Name"
.LinkedCell = "Sheet3!A1"
.Object.Caption = "ABCD:
.Object.GroupName = "Group1"
End With

the linkedcell property is provided by the container which is the OleObject
Shape and OleObject share the same name. In xl2000 and later, the checkbox
name will also be the OleObject and ShapeName.

The caption is a property of the Checkbox, so you have to append .Object to
the OleObject to refer to the checkbox. Same for groupname.

--
Regards,
Tom Ogilvy


"scottrell " wrote in message
...
Excel XP SP2
I need to set the LinkedCell property on a control with VB, both for
optionbuttons and checkboxes, but I cannot find a way to access the
property in VB (I also want to set the GroupName and Caption, but
assume the answer would be similar).

I'm able to set the name (height, width, top, left, etc) with (e.g.):

ActiveWorkbook.Worksheets("Sheet1").Shapes("CheckB ox1").Name =
"Checkbox1Name"

but not the other three properties mentioned above.

These controls are on a worksheet and not a form, the Help system has
let me down.

-sc


---
Message posted from http://www.ExcelForum.com/



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Setting LinkedCell on a CheckBox Control

Thank you.

Exactly what I needed.

-s

--
Message posted from http://www.ExcelForum.com

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
problem with checkbox control Giselle Excel Worksheet Functions 1 March 31st 06 12:57 PM
how do I protect a worksheet and still use a checkbox control JayS Excel Worksheet Functions 4 September 8th 05 07:36 AM
resize control checkbox with cell packat Excel Discussion (Misc queries) 2 December 27th 04 01:16 PM
Setting LinkedCell of individual OptionButton Angelito Cruz Excel Programming 3 June 1st 04 09:25 PM
VBA Control Checkbox Tommy[_6_] Excel Programming 2 August 7th 03 06:02 PM


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

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"