+ Reply to Thread
Results 1 to 3 of 3

Thread: Can you use VBA to mark selected/deselect activeX control check box?

  1. #1
    Forum Contributor
    Join Date
    12-20-2011
    Location
    United States, Ohio
    MS-Off Ver
    Excel 2010
    Posts
    242

    Can you use VBA to mark selected/deselect activeX control check box?

    I have an ActiveX Control check box located on Sheet1 called Checkbox4.

    This checkbox has small procedures tied to it that run onced mark as being "selected" or "unselected" or "checked" and un-checked" (however you look at it).

    And these small procedures runs just fine when the user does indeed click on the check box - BUT My current VBA code ISNT marking them as being true or false with simply:
    Sheet1.Select
    CheckBox4 = False
    or
    Sheet1.Select
    CheckBox4 = True

    I have this located within a if statment that uses the answer from a vbYesno message box.
    Last edited by clemsoncooz; 01-23-2012 at 10:55 AM.

  2. #2
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & read 2007
    Posts
    15,979

    Re: Can you use VBA to mark selected/deselect activeX control check box?

    Hello clemsoncooz,

    The syntax for ActiveX objects on a worksheet is a little more complex. This example will "check" the control. Set the value to false to clear the "check".
    Worksheets("Sheet1").OLEObjects("CheckBox4").Object.Value = True
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

  3. #3
    Forum Contributor
    Join Date
    12-20-2011
    Location
    United States, Ohio
    MS-Off Ver
    Excel 2010
    Posts
    242

    Re: Can you use VBA to mark selected/deselect activeX control check box?

    Perfect! Thank you!
    Last edited by clemsoncooz; 01-23-2012 at 10:54 AM.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.2.0