User Form - Code Needed

HowdyTX

New Member
Joined
Apr 19, 2004
Messages
17
I'm clueless - really. I was tasked with creating a user form that populates a spreadsheet. The trained person who was supposed to do this left the company abruptly. And so here I am... an English Lit major! I have created the form below by following various examples that I found online. But, now I need to add the code (? Not sure what that is) that will collect the data as the form is populated. Oh goodness, help!

Form:


Spreadsheet Data:
Excel Workbook
ABCDEFGHIJK
1IDFirst NameLast NamePhoneEmailSchoolTeacherGradeName of registered adult accompanying this studentPhoto release signed and turned into teacherStudent may not be photographed
21JoeSmith111-222-3333jsmith@aol.comUpper SideJoe Teach10Jane SmithNoNo
32JaneDoe444-555-6666JDoe@yahoo.comLower SchoolCool Prof11Cecilia SecondYesYes
Registration


Thanks Everyone :)
 

Excel Facts

How to calculate loan payments in Excel?
Use the PMT function: =PMT(5%/12,60,-25000) is for a $25,000 loan, 5% annual interest, 60 month loan.
I do not know why the picture of the form did not show up.

You'll need to use an online site where you can store the image, then post the image link.

I take it that all of the elements in the screen shot are text boxes in the user form and you just need to transfer the data? If so here's a start:

<font face=Calibri><SPAN style="color:#00007F">Private</SPAN> <SPAN style="color:#00007F">Sub</SPAN> CommandButton1_Click()<br>    <SPAN style="color:#00007F">Dim</SPAN> i <SPAN style="color:#00007F">As</SPAN> <SPAN style="color:#00007F">Long</SPAN>, LastRow <SPAN style="color:#00007F">As</SPAN> <SPAN style="color:#00007F">Long</SPAN><br>    <br>        <SPAN style="color:#007F00">'   Find the first empty row to add new data</SPAN><br>        LastRow = Sheets("Registration").Cells(Rows.Count, "A").End(xlUp).Offset(1).Row<br>        <br>        <SPAN style="color:#007F00">'   Assumes you have 4 text boxes - Increase as necessary</SPAN><br>        <SPAN style="color:#00007F">For</SPAN> i = 1 <SPAN style="color:#00007F">To</SPAN> 4<br>            <SPAN style="color:#007F00">'   This loops through the columns in the empty row and adds the value</SPAN><br>            <SPAN style="color:#007F00">'   from each successive Text Box to it</SPAN><br>            Sheets("Registration").Cells(LastRow, i).Value = Controls("TextBox" & i)<br>        <SPAN style="color:#00007F">Next</SPAN> i<br>        <br><SPAN style="color:#00007F">End</SPAN> <SPAN style="color:#00007F">Sub</SPAN></FONT>

HTH,
 
Upvote 0

Forum statistics

Threads
1,215,222
Messages
6,123,717
Members
449,116
Latest member
Aaagu

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