INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Jobs

Need help with Excel ActiveX TextBox Properties and Procedures

Need help with Excel ActiveX TextBox Properties and Procedures

(OP)
I am working with Excel 2007 on Vista and I have an ActiveX TextBox on an Excel spreadsheet where the user inputs an 8 number ID. I am trying to fiugre the code so after the user enters their 8 number ID it calls a macro that clears a range on a separater worksheet and then returns to the original worksheet and I want it to focus on my first ListBox.

I am uncertain how to set the Properties of the TextBox, and also unclear which 'procedure' to use.

I appreciate any direction to solve this and also to any clearing house of information pertaining to ActiveX Controls

Thank you

RE: Need help with Excel ActiveX TextBox Properties and Procedures

The forum dedicated to vba is forum707: VBA Visual Basic for Applications (Microsoft).
Assuming that you need to clear a range in the same worksheet, the control is named TextBox1:

CODE -->

Private Sub TextBox1_Change()
If Me.TextBox1.Text Like "########" Then
    ' test textbox text here
    Me.Parent.Worksheets("SomeWsName").Range("A1:C3").Clear
Else
    If Len(Me.TextBox1.Text) = 8 Then
        MsgBox "wrong 8-character text"
    End If
End If
End Sub 
Double-click the control in the sheet in design mode and you should get the frame of the event procedure.
There is no need to select destination sheet.

combo

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Resources

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close