+ Reply to Thread
Results 1 to 3 of 3

Controls in Worksheet vs on UserForms

Hybrid View

  1. #1
    Registered User
    Join Date
    04-20-2009
    Location
    USA
    MS-Off Ver
    Excel 2003
    Posts
    29

    Controls in Worksheet vs on UserForms

    Hello -

    Do controls dropped in a worksheet have the same properties as controls placed on UserForms?
    I have a checkbox in a sheet and I can't seem to get its state from the macro. I try:
    Worksheets("Sheet1").CheckBox93.Value = True
    and nothing happens...

    Thanks!

  2. #2
    Forum Expert Palmetto's Avatar
    Join Date
    04-04-2007
    Location
    South Eastern, USA
    MS-Off Ver
    XP, 2007, 2010
    Posts
    3,978

    Re: Controls in Worksheet vs on UserForms

    Do controls dropped in a worksheet have the same properties as controls placed on UserForms?
    They do if the control is from the Active-X controls and not from the Forms controls.

    If your checkbox is from the Forms tool box, then you need to link the check box to a cell and test the cell value for true or false.
    Assuming cell A1 is the linked cell . .
    If Range("A1").Value = True then
    'Code
    End If
    If your checkbox is an Active-X type, then something like:

    If Me.CheckBox1.Value = True then
    'code
    End If
    Palmetto

    Do you know . . . ?

    You can leave feedback and add to the reputation of all who contributed a helpful response to your solution by clicking the star icon located at the left in one of their post in this thread.

  3. #3
    Registered User
    Join Date
    04-20-2009
    Location
    USA
    MS-Off Ver
    Excel 2003
    Posts
    29

    Re: Controls in Worksheet vs on UserForms

    Quote Originally Posted by Palmetto View Post
    They do if the control is from the Active-X controls and not from the Forms controls.

    If your checkbox is from the Forms tool box, then you need to link the check box to a cell and test the cell value for true or false.
    Assuming cell A1 is the linked cell . .
    If Range("A1").Value = True then
    'Code
    End If
    If your checkbox is an Active-X type, then something like:

    If Me.CheckBox1.Value = True then
    'code
    End If
    Got it! Thanks...

+ 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.6.0 RC 1