Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
User form issues
I want to take data that users input into a User form into the spread sheet.
I currently have 4 text boxes that are called: TextBox1 TextBox2 TextBox3 TextBox4 I would like TB1 to input into Column A, TB2 into Column C, TB3 into Column D, TB4 into Column E. The worksheet is named "Expense Non Amex" If its possible id like the form to repeat if the New Reciept Button is pushed and again until the button called Done is selected. Thank you very much!! |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
User form issues
Amazing thank you very much!
"JLGWhiz" wrote: I could have made this a few lines shorter, but this way you can see what is happening for each text box by reading the code. Put this code in the code window behind your UserForm. Right click the UserForm, then click view code in the drop down menu to open the code window. Private Sub CommandButton1_Click() 'Change button, if required Set wks = Worksheets("Expense Non Amex") lrA = wks.Cells(Rows.Count, 1).End(xlUp).Row lrB = wks.Cells(Rows.Count, 2).End(xlUp).Row lrC = wks.Cells(Rows.Count, 3).End(xlUp).Row lrD = wks.Cells(Rows.Count, 4).End(xlUp).Row wks.Range("A" & lrA + 1) = TextBox1.Text wks.Range("B" & lrA + 1) = TextBox2.Text wks.Range("C" & lrA + 1) = TextBox3.Text wks.Range("D" & lrA + 1) = TextBox4.Text TextBox1.Text = "" TextBox2.Text = "" TextBox3.Text = "" TextBox4.Text = "" End Sub Private Sub CommandButton2_Click() 'Change button, if required Unload UserForm1 'Change form name, if required End Sub You can put a call-up macro in the standard code module to activate your form with the following code. Sub callMyForm() UserForm1.Show 'Change form name, if required End Sub Just make sure that all of the control names, sheetnames and form names are changed to match what you are using. "Ewing25" wrote: I want to take data that users input into a User form into the spread sheet. I currently have 4 text boxes that are called: TextBox1 TextBox2 TextBox3 TextBox4 I would like TB1 to input into Column A, TB2 into Column C, TB3 into Column D, TB4 into Column E. The worksheet is named "Expense Non Amex" If its possible id like the form to repeat if the New Reciept Button is pushed and again until the button called Done is selected. Thank you very much!! |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Multiple User issues | Excel Worksheet Functions | |||
FORM Drop Down issues | Excel Programming | |||
User Form issues | Excel Programming | |||
help! user form issues; can't find subroutines; appearance issue | Excel Programming | |||
User Form Initialize Event Issues | Excel Programming |