DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2

Thread: excel-vba | want to see if a checkbox is checked or not

  1. #1
    Join Date
    Oct 2005
    Posts
    3

    excel-vba | want to see if a checkbox is checked or not

    I'm trying to add in a "save username and password" checkbox on my excel sheet, but can't seem to reference it from the code, so I can see if it's checked or not.

    I tried:

    chbxSaveUNPW.checked = false
    chbxSaveUNPW.value = 0
    sheet2.chbxSaveUNPW.value = 0

    The code doesn't recognize my checkbox. =( How do I reference an object on a sheet? I don't want to run a macro when it's clicked, just want to see if it's checked or not.

    What is this object's parent? How do I reference it?

  2. #2
    Join Date
    Dec 2003
    Posts
    2,750
    The following works for me:

    Worksheets("Sheet1").CheckBox1.Value

    or

    Sheets("Sheet1").CheckBox1.Value
    Paul
    ~~~~
    Microsoft MVP (Visual Basic)

Similar Threads

  1. Excel VBA Deleted Rows
    By kctse1 in forum VB Classic
    Replies: 0
    Last Post: 09-27-2005, 02:42 AM
  2. Creating a virtual table in VBA Excel
    By Werner in forum VB Classic
    Replies: 0
    Last Post: 06-16-2005, 02:04 PM
  3. Matching data macro in VBA Excel
    By Werner in forum VB Classic
    Replies: 2
    Last Post: 06-15-2005, 02:13 PM
  4. Excel, VBA, SQL, DAO 3.6 help needed
    By Jared Evans in forum VB Classic
    Replies: 2
    Last Post: 05-29-2003, 04:44 PM
  5. Need Help with VBA for Excel
    By Bob in forum VB Classic
    Replies: 0
    Last Post: 03-14-2002, 03:27 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center