Private Sub Submit_Click()
Dim ws As Worksheet
Dim i As Integer
Set ws = Sheets("Register")
' Return data to the worksheet
With ws
.Range("A4") = TextBox1.Value
.Range("B4") = TextBox2.Value
.Range("C4") = TextBox3.Value
.Range("D4") = TextBox4.Value
.Range("E4") = TextBox5.Value
.Range("F4") = TextBox6.Value
.Range("G4") = TextBox8.Value
.Range("H4") = TextBox10.Value
.Range("I4") = TextBox11.Value
End With
' Clear the TextBoxes
For i = 1 To 11
TextBox(i).Value = ""
Next i
End Sub
This is comming up with the following issue: Compile Error Sub or Function not defined (on the TextBox(i).Value).
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.