Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

if then statement in excel

Status
Not open for further replies.

ironj32

Technical User
Dec 7, 2006
73
0
0
US
I have a set of check boxes in excel one of them being "chkOther". when this is true i want the cursor to go to a text boxt "txtVendorPerfOther" and I want to make it required. If it's not true then i would like for txtVendorPerfOther to be locked.
here is what i have so far...
Code:
Private Sub chkVendorPerfOther()
If chkVendorPerfOther Is True Then
txtVendorPerfOther ????
???
End If
End Sub
thanks for any help!
 
Something like:

Code:
Private Sub chkOther_Click()

  If chkOther = True Then
    ' Ticked
    txtVendorPerfOther.SetFocus
  Else
    ' Not ticked
    txtVendorPerfOther.Enabled = False
    txtVendorPerfOther = ""
  End If

End Sub
 
this code does not seem to do anything...?

Code:
Private Sub chkVendorPerfOther_Click()

  If chkVendorPerfOther = True Then
    ' Ticked
    txtVendorPerfOther.SetFocus
  Else
    ' Not ticked
    txtVendorPerfOther.Enabled = False
    txtVendorPerfOther = ""
  End If

End Sub
 
i should note that the check boxes i am using are from the Form tool bar...does it make a difference if it is a Form object or a Control object?
 
......aaannnnnd it does! things might be a little easier now. at this point you can all ignore my posts in this thread. thanks!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top