Hi
I have this code when run the form will increment in textbox1 and populate in E2 every time but will show space after "000" , I don't want it .
for instance when ru the form I would like this AA 00032343, not this AA 000 32343
Private Sub UserForm_Initialize()
Dim ss As String
Dim r As Integer
ss = "AA 000"
If Range("E2") = "" Then 'Check if this is the first user of the form
r = 32338
Else
r = Right(Range("e2").Value, 5) + 1 ' not, add 1 to last value
End If
Me.TextBox1.Text = ss & Str(r)
Range("E2").Value = Me.TextBox1.Text 'write this value to sheet(and later write other default values)
End Sub