Closed Thread
Results 1 to 4 of 4

Change output value of checkbox

Hybrid View

  1. #1
    Registered User
    Join Date
    06-22-2010
    Location
    Dallas TX
    MS-Off Ver
    Excel 2003
    Posts
    37

    Change output value of checkbox

    I've placed a checkbox in a userform. Instead of returning a value of True or False in the spreadsheet, I would like to change the response to Pass or Fail. Can anyone assist?

  2. #2
    Forum Expert Tinbendr's Avatar
    Join Date
    06-26-2012
    Location
    USA
    MS-Off Ver
    Office 2010
    Posts
    2,125

    Re: Change output value of checkbox

    Quote Originally Posted by melcoats View Post
    ... I would like to change the response to Pass or Fail.
    And do what with that response? Post it to the sheet. Change the caption of the checkbox, ....

    Select Case True
    Case CheckBox1
      Range("A1").Value = "Pass"
    
    Case CheckBox2
      Range("A2").Value = "Pass"
    End Select
    David
    (*) Reputation points appreciated.

  3. #3
    Registered User
    Join Date
    06-22-2010
    Location
    Dallas TX
    MS-Off Ver
    Excel 2003
    Posts
    37

    Re: Change output value of checkbox

    Yes, I would like to post the response in a spreadsheet.

    Here is my code so far:


    Private Sub cmdOK_Click()
        ActiveWorkbook.Sheets("QAData").Activate
        Range("A1").Select
        
        If txtPassword = "password" Then
        
           Do
        If IsEmpty(ActiveCell) = False Then
           ActiveCell.Offset(1, 0).Select
        End If
        Loop Until IsEmpty(ActiveCell) = True
        
        ActiveCell.Value = txtCustomerName
        ActiveCell.Offset(0, 1) = txtProjectNumber.Value
        ActiveCell.Offset(0, 2) = txtProductType.Value
        ActiveCell.Offset(0, 3) = txtQtyManufactured.Value
        ActiveCell.Offset(0, 4) = txtQtyShipped.Value
        ActiveCell.Offset(0, 5) = txtInspectDate.Value
        ActiveCell.Offset(0, 6) = txtShipDate.Value
        ActiveCell.Offset(0, 7) = txtInspectedBy.Value
        ActiveCell.Offset(0, 8) = chkboxTSDelam1.Value
     
        
            Else
    MsgBox "Wrong password, please try again"
    End If
    
        
            Range("A1").Select
    End Sub
    
    
    Private Sub cmdClear_Click()
        Call UserForm_Initialize
        
    End Sub
    
    
    Private Sub UserForm_Initialize()
    
    txtCustomerName.Value = ""
    txtProjectNumber.Value = ""
    txtProductType.Value = ""
    txtQtyManufactured.Value = ""
    txtQtyShipped.Value = ""
    txtInspectDate.Value = ""
    txtShipDate.Value = ""
    txtInspectedBy.Value = ""
    
    
    chkboxTSDelam1.Value = ""
    
    
    
    
    
    txtCustomerName.SetFocus
    
    End Sub
    Last edited by arlu1201; 07-31-2012 at 03:23 PM. Reason: Clarification

  4. #4
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: Change output value of checkbox

    Melcoats,

    Welcome to the Forum, unfortunately:

    This is a duplicate post and as such does not comply with Rule 5 of our forum rules. This thread will now be closed, you may continue in your other thread.

    Thread Closed.
    If I have helped, Don't forget to add to my reputation (click on the star below the post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)
    Use code tags when posting your VBA code: [code] Your code here [/code]

Closed 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