Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default set/get value of checkbox (controltoolbox)

Trying to get/set value from a checkbox.
I'm using the controltoolbox-checkbox.
I'm using:
Worksheets("refdata").Shapes(varname).ControlForma t.Value = 1

but getting a object does not support property error.
I need to refer to the checkbox with "varname" being af changable variable.

What is the correct syntax?
Thanks.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 420
Default set/get value of checkbox (controltoolbox)

I'd use something like:

Option Explicit
Sub testme()
Dim CBX As OLEObject
Set CBX = Worksheets("sheet1").OLEObjects("checkbox1")

CBX.Object.Value = True

End Sub



On 04/18/2012 06:21, Jesper F wrote:
Trying to get/set value from a checkbox.
I'm using the controltoolbox-checkbox.
I'm using:
Worksheets("refdata").Shapes(varname).ControlForma t.Value = 1

but getting a object does not support property error.
I need to refer to the checkbox with "varname" being af changable variable.

What is the correct syntax?
Thanks.


--
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
OptionButtons from ControlToolbox PCLIVE Excel Programming 5 January 19th 09 07:44 PM
How to have Checkbox A uncheck with checked Checkbox B Texas Aggie Excel Discussion (Misc queries) 3 July 20th 07 10:58 PM
link a checkbox in a sheet to a checkbox on a userform? Arjan Excel Programming 0 November 10th 06 01:37 PM
How do I link one checkbox to update another checkbox? Mike Excel Programming 3 April 28th 06 02:22 AM
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 05:18 PM.

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

About Us

"It's about Microsoft Excel"