Posting Data with new form text boxes

woodland81

New Member
Joined
Dec 27, 2010
Messages
14
Hello,

I have an excel spreadsheet, it was made by someone else but i have worked out what to edit and amend over time to improve its usage. it has a Form with multiple text boxes, which when submitted, posts the data into an Archive Tab, each text box on the form, posting the contents to the next column in the series.

I managed to work out how to extend the range of columns it would post the data, but when I add new text boxes to the form and increase what I think is the range, I get an undefined error and/or the data doesnt materialise on the stored data sheet.

Now when i increase the C numbers it doesnt post the next data.
Tried copying the previous text box and increase the number range up by 1 but it has come to a point where its no longer working.
The Grey boxes I want to have text boxes which then post to the next field.

Any ideas, im sure its an easy tweak somewhere?

--------------------------------------

Application.Calculation = xlCalculationManual

Worksheets("Archive").Range("A" & rw).Value = UserForm1.ComboBox1 & UserForm1.ComboBox3

42915 Worksheets("Archive").Range("B" & rw).Value = Format(UserForm1.ComboBox1, "m/d/yyyy")

Worksheets("Archive").Range("D" & rw).Value = UserForm1.ComboBox3

For c = 5 To 70

frminput = "TextBox" & c - 5

Worksheets("Archive").Cells(rw, c).Value = UserForm1.Controls(frminput)

Next c

MsgBox "Information has been successfully input. Please input more information or click OK then Cancel to exit."

UserForm1.ComboBox1.ListIndex = -1

UserForm1.ComboBox3.ListIndex = -1

For c = 0 To 65
frminput = "TextBox" & c

UserForm1.Controls(frminput).Value = 0

Next c

Application.Calculation = xlCalculationAutomatic



End Sub

--------------------------------------------------------
 

Attachments

  • code.JPG
    code.JPG
    101.3 KB · Views: 11
  • form.JPG
    form.JPG
    194.9 KB · Views: 11
  • data.JPG
    data.JPG
    59.8 KB · Views: 11

Excel Facts

Select all contiguous cells
Pressing Ctrl+* (asterisk) will select the "current region" - all contiguous cells in all directions.

Forum statistics

Threads
1,215,071
Messages
6,122,964
Members
449,094
Latest member
Anshu121

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