1. Computer problem? Tech Support Guy is completely free -- paid for by advertisers and donations. Click here to join today! If you're new to Tech Support Guy, we highly recommend that you visit our Guide for New Members.

Active X Checkboxes-VBA

Discussion in 'Business Applications' started by kls, May 28, 2002.

Thread Status:
Not open for further replies.
  1. kls

    kls Thread Starter

    Joined:
    May 17, 2002
    Messages:
    8
    I have several checkboxes on a worksheet; ~50. I would like to set up a Command Button to reset all the checkboxes = to False. I'm looking for a better way to set all the checkboxes to false without having to type each one....CheckBox1.Object.Value = False.

    Any ideas??
     
  2. THoey

    THoey

    Joined:
    Feb 12, 2001
    Messages:
    3,420
    But I have seen others write code that iterates through all the objects on a form, checks the type of the object, and based on that type, performs some function. Something like:

    Private Sub ClearAll ()
    Dim ctl As Control

    For Each ctl In Me.Controls
    If ctl.ControlType = acCheckbox Then
    ctl.Enabled = FALSE
    End If
    Next ctl
    End Sub

    Like I said, I haven't done this and this code probably has a lot of errors, but it should put you on the right track...
     
  3. kls

    kls Thread Starter

    Joined:
    May 17, 2002
    Messages:
    8
    Thanks, I'll give this a try.
     
As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 733,556 other people just like you!

Thread Status:
Not open for further replies.

Short URL to this thread: https://techguy.org/81472

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice