View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Mike H Mike H is offline
external usenet poster
 
Posts: 11,501
Default switch automatically between text boxes

Hi,

You could attach this code to textbox1

Private Sub TextBox1_DblClick(ByVal Cancel As MSForms.ReturnBoolean)
If Len(TextBox1.Text) < 6 Then
MsgBox "Wrong number of characters, Enter 6 numbers"
TextBox1.Text = ""
Exit Sub
End If
TextBox3.Text = Right(TextBox1, 4)
TextBox1.Text = Left(TextBox1, 2)
End Sub

Mike

"Valeria" wrote:

Dear experts,
I have a spreadsheet (excel 2003) which contains a userform wiht 3 textboxes.
Users need to enter their input on textbox 1 &3, the one in the middle has a
set value.
textbox 1 = 4 characters
textbox 3 = 2 characters
I would like the users to be able to input the values for textboxes 1 & 3
without having to hit the tab key, so basically input the 6 characters at the
time which would split into the textboxes 1 & 3

Is this possible?
Thanks for your help,
Best regards
--
Valeria