Modifing a userform txtbox code

J

jsnelson

Below is a code for a text box in a userform that accepts one
character and then goes to the next cell. How do i modify it to accept
ten characters and then move to the next cell.

Thanks



Private Sub TextBox1_Change()


If blkProc Then Exit Sub
ActiveCell.Value = Me.TextBox1.Value
blkProc = True
Me.TextBox1.Value = ""
blkProc = False


ActiveCell.Offset(1, 0).Activate


End Sub
 
B

Bernie Deitrick

js,

Try

If blkProc Then Exit Sub
If Len(Me.textbox1.Value) = 10 Then
ActiveCell.Value = Me.textbox1.Value
blkProc = True
Me.textbox1.Value = ""
blkProc = False
ActiveCell.Offset(1, 0).Activate
End If

HTH,
Bernie
MS Excel MVP
 
J

jsnelson

js,

Try

If blkProc Then Exit Sub
If Len(Me.textbox1.Value) = 10 Then
ActiveCell.Value = Me.textbox1.Value
blkProc = True
Me.textbox1.Value = ""
blkProc = False
ActiveCell.Offset(1, 0).Activate
End If

HTH,
Bernie
MS Excel MVP











- Show quoted text -

Thanks Bernie
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top