Form not working

KRKComputers

New Member
Joined
Nov 10, 2017
Messages
43
I am wondering if someone can give me some input as to why this may not be working! I have the following code that I am using and it has been attached to a sheet called Main Table and for some reason I am not getting any errors with the code however when I try to input anything into the input boxes I do not get any entry on my spreadsheet which I find odd.

The spreadsheet does have 280 entries already in place and I did try the code on an empty sheet as well and get the same response it does not work and will not populate the fields as it should be doing.

When I hi the ENTER button the fields do not clear and start the process all over again. If anyone can give me some insight it would be greatly appreciated.

Code:
Private Sub CommandButton()If TextBox1.Value = "" Or TextBox2.Value = "" Or TextBox3.Value = "" Or TextBox4.Value = "" Or TextBox5.Value = "" Or TextBox6.Value = "" Or TextBox7.Value = "" Or TextBox8.Value = "" Or TextBox9.Value = "" Or TextBox10.Value = "" Or TextBox11.Value = "" Or TextBox12.Value = "" Or TextBox13.Value = "" Or TextBox14.Value = "" Or TextBox15.Value = "" Then
    If MsgBox("Form is not complete. Do you want to continue?", vbQuestion + vbYesNo) <> vbYes Then
        Exit Sub
        End If
    End If


ActiveCell = TextBox1.Value
ActiveCell.Offset(0, 1) = TextBox2.Value
ActiveCell.Offset(0, 2) = TextBox3.Value
ActiveCell.Offset(0, 3) = TextBox4.Value
ActiveCell.Offset(0, 4) = TextBox5.Value
ActiveCell.Offset(0, 5) = TextBox6.Value
ActiveCell.Offset(0, 6) = TextBox7.Value
ActiveCell.Offset(0, 7) = TextBox8.Value
ActiveCell.Offset(0, 8) = TextBox9.Value
ActiveCell.Offset(0, 9) = TextBox10.Value
ActiveCell.Offset(0, 10) = TextBox11.Value
ActiveCell.Offset(0, 11) = TextBox12.Value
ActiveCell.Offset(0, 12) = TextBox13.Value
ActiveCell.Offset(0, 13) = TextBox14.Value
ActiveCell.Offset(0, 14) = TextBox15.Value


ActiveCell.Offset(1, 0).Select


Cell ResetForm


End Sub


Sub ResetForm()
TextBox1.Value = ""
TextBox2.Value = ""
TextBox3.Value = ""
TextBox4.Value = ""
TextBox5.Value = ""
TextBox6.Value = ""
TextBox7.Value = ""
TextBox8.Value = ""
TextBox9.Value = ""
TextBox10.Value = ""
TextBox11.Value = ""
TextBox12.Value = ""
TextBox13.Value = ""
TextBox14.Value = ""
TextBox15.Value = ""


UserForm1.TextBox1.SetFocus


End Sub
 

Excel Facts

Workdays for a market open Mon, Wed, Friday?
Yes! Use "0101011" for the weekend argument in NETWORKDAYS.INTL or WORKDAY.INTL. The 7 digits start on Monday. 1 means it is a weekend.
Where is the active cell being set/selected?
 
Upvote 0
The data from TextBox1 is being put in the active cell and the data from the other textboxes is being put in adjacent columns in the same row.

Do you have code elsewhere that is setting the active cell/row?

Where should the data be going?
 
Upvote 0
I have created a spreadsheet that has the following headings in exact order as show.

USERNAME - PHONE NUMBER - DEVICE MODEL - IMEI - ACTIVATED - NON-ACTIVATED - ROGERS - BELL - TRANSFER/ACTIVE - PORTING - SPARE POOL - APPLE ID LOCKED - GOOGLE ID LOCKED - COMMENTS.

What I am trying to do is populate each field using the form rather then selecting each cell.

Thanks for your help it is appreciated
 
Upvote 0
Where do you want the data from TextBox1-TextBox15 to go?
 
Upvote 0
I would like to do it according to the headers in the exact same order.

So text box 1 will be Username and so on.

Thanks for your patience and help once again.

Forgot to add starting cell A2 B2 and so on as well due to a heading in first row of cells.
 
Last edited:
Upvote 0
Norie,

My apologies for the delay in getting back to you. The reason for the delay is I managed to figure things out in the end and got it all up and running. I appreciate the effort that you made in trying to help me out as well as the patience.

Hope you had a great New Year!

Thanks
Kevin
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,181
Members
453,022
Latest member
Mohamed Magdi Tawfiq Emam

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top