Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 62
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 62
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Multiple User issues Mark W.[_2_] Excel Worksheet Functions 0 December 15th 08 09:03 PM
FORM Drop Down issues Dave[_9_] Excel Programming 3 September 26th 07 07:56 PM
User Form issues Barb Reinhardt Excel Programming 1 October 16th 06 04:19 PM
help! user form issues; can't find subroutines; appearance issue in-over-his-head-bill Excel Programming 3 July 6th 06 10:24 PM
User Form Initialize Event Issues Randy[_10_] Excel Programming 3 December 4th 05 11:20 AM


All times are GMT +1. The time now is 03:06 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"