Jammydan
Board Regular
- Joined
- Feb 15, 2010
- Messages
- 141
Hi
I have a simple userfrom which completes an account number(in 3 parts e.g 01/0000/01 with option of filling in 3 accounts.
My problem is if I only complete 1 account such as 01/00000/01 and then close the userform, it only enters 01/0000 and not the last 2 digits?
I have a simple userfrom which completes an account number(in 3 parts e.g 01/0000/01 with option of filling in 3 accounts.
My problem is if I only complete 1 account such as 01/00000/01 and then close the userform, it only enters 01/0000 and not the last 2 digits?
Code:
Private Sub OKButton_Click()
Application.ScreenUpdating = False
'****CASH ACCOUNTS****
If TextBox1.Text <> "" Then Range("B17").End(xlDown).Offset(0, 35).Select
Selection = TextBox1.Text
If TextBox2.Text <> "" Then Range("B17").End(xlDown).Offset(0, 36).Select
Selection = TextBox2.Text
If TextBox3.Text <> "" Then Range("B17").End(xlDown).Offset(0, 37).Select
Selection = TextBox3.Text
If TextBox4.Text <> "" Then Range("B17").End(xlDown).Offset(0, 42).Select
Selection = TextBox4.Text
If TextBox5.Text <> "" Then Range("B17").End(xlDown).Offset(0, 43).Select
Selection = TextBox5.Text
If TextBox6.Text <> "" Then Range("B17").End(xlDown).Offset(0, 44).Select
Selection = TextBox6.Text
If TextBox7.Text <> "" Then Range("B17").End(xlDown).Offset(0, 49).Select
Selection = TextBox7.Text
If TextBox8.Text <> "" Then Range("B17").End(xlDown).Offset(0, 50).Select
Selection = TextBox8.Text
If TextBox9.Text <> "" Then Range("B17").End(xlDown).Offset(0, 51).Select
Selection = TextBox9.Text
Unload UserFormAdditional
Range("B17").End(xlDown).Select