View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Charles Harmon Charles Harmon is offline
external usenet poster
 
Posts: 48
Default auto number form

Alex,

Here is a code that will start the listbox text with "0" then each time you
Tab or press the Enter key on textbox2 Textbox1 will increment. You need to
set the Property value of Textbox1 Text to "0".

HTH

Charles

Private Sub Textbox2_KeyDown(ByVal KeyCode As MSForms.ReturnInteger, ByVal
Shift As Integer) 'tab key
Application.ScreenUpdating = False
If KeyCode = "9" Or KeyCode = "13" Then
With UserForm1
.TextBox1.Text = .TextBox1.Text + 1
End With
End If
End Sub

"alex.simms" wrote in message
...
I would like to include a text box in a form in which the number in the box
will increment by one each time textbox1 is filled.
can any one suggest a method of achieving this

--
regards
ALEX