Ozgrid Excel Help Forums & Excel Best Practices


XL Templates | XL Add-ins | XL Training | XL Estimating | XL Scheduling | XL Recovery | XL Trading | XL Financial | XL Conversion | XL Charting


<
Closed Thread
Results 1 to 5 of 5

Thread: [Solved] Controls (Control Toolbox): VBA: Evaluating Checkbo

  1. #1
    Join Date
    31st May 2003
    Location
    Ramona, CA
    Posts
    75
    Hello,
    I have added about 10 or 15 check boxes on a sheet and my basic goal is to have the procedure evaluate the sheet to see if the all checkboxes are checked if they are I want it to exit the sub but if they are not I want it to bring up one message box that notifies me that I need to review the list to see what items off the list I need to take care of. I started by writing the code below but it seems to be getting caught up on dim the Checkbox.

    Private Sub Warning()
    Dim myCandidate
    Set myCandidate = Range("Rcandnam")
    Dim Chbx As xlCheckbox
    Dim Ws As Worksheet
    Set Ws = Worksheets("Template3") 'Documents
    For Each Chbx In Ws
    If Chbx = False Then
    MsgBox myCandidate & " has only a few weeks before departue and" & vbCrLf _
    & " they still have portions of the Document Packet to fill out." & vbCrLf _
    & "Check the Documents tab and encourage your candidate to turn" & vbCrLf _
    & " the outstanding documents in as soon as possible.", 48, "Documents Still Outstanding"
    End If
    Next Chbx
    End Sub

  2. #2
    Join Date
    7th March 2003
    Location
    Essex, England
    Posts
    11,319
    Hi elopez,

    You should be able to modify the attached example to suit your needs.

    Cheers
    Andy

    Cheers
    Andy


  3. #3
    Join Date
    31st May 2003
    Location
    Ramona, CA
    Posts
    75
    Andy,
    Thanks. This really helps. I got it all in and it works but I would like for the CheckBox caption to show instead of its default name. I tried adjusting the strMsg to strMsg= strMsg & Chbx.Caption & vbCrLf rather than just
    strMsg = strMsg & Chbx.Name & vbCrLf but that doesn't seem to work. Do you have any suggestions?
    Thanks

  4. #4
    Join Date
    7th March 2003
    Location
    Essex, England
    Posts
    11,319
    Hi elopez,

    The Caption property requires the Object object, so try;

    strMsg = strMsg & Chbx.Object.Caption & vbCrLf

    Cheers
    Andy

    Cheers
    Andy


  5. #5
    Join Date
    31st May 2003
    Location
    Ramona, CA
    Posts
    75

    Create Excel dashboards quickly with Plug-N-Play reports.
    Andy,
    It works great, thanks a bunch.
    Thanks again,
    elopez

Closed Thread

Thread Information

Users Browsing this Thread

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

     

Possible Answers

  1. Replies: 2
    Last Post: May 4th, 2004, 05:30
  2. Replies: 3
    Last Post: December 16th, 2003, 20:49
  3. Replies: 4
    Last Post: November 11th, 2003, 01:10
  4. Replies: 2
    Last Post: August 26th, 2003, 22:04
  5. Replies: 12
    Last Post: August 19th, 2003, 19:59

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