Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
User form and Command button
Hello I created a user custom form with the help of Excel 2002 Visual Basic
Book. My problem is that I created 2 command buttons in the user form, one a cancel button, and that is OK, the other is "Add customer" and that is where I am having problems, four hours of problem. Once the user form is completed and the "add customer " button is selected I want the information to go the the spreahsheet. How to I do this? Thanks |
#2
Posted to microsoft.public.excel.misc
|
|||
|
|||
User form and Command button
hi,
you can try something like this..... Private Sub CommandButton1_Click() Dim r As Range 'Set r = Workbooks("Book1").Sheets("Sheet1").Range("A1") 'use this to sent value to same place over and over Set r = ActiveSheet.Range("A65000").End(xlUp).Offset(1, 0) 'use this if you are creating a database with rows of customers. r.Value = textbox1.Value 'Set the value on the sheet textbox1.Value = "" 'clears the form if needed End Sub adjust to your stuff. this only works on 1 textbox and one cell. you will need to add a line and a variable for each textbox on your form. regards FSt1 "Marilyn" wrote: Hello I created a user custom form with the help of Excel 2002 Visual Basic Book. My problem is that I created 2 command buttons in the user form, one a cancel button, and that is OK, the other is "Add customer" and that is where I am having problems, four hours of problem. Once the user form is completed and the "add customer " button is selected I want the information to go the the spreahsheet. How to I do this? Thanks |
#3
Posted to microsoft.public.excel.misc
|
|||
|
|||
User form and Command button
There are instructions and sample file for a UserForm he
http://www.contextures.com/xlUserForm02.html The 'Add this part' button sends the information to a worksheet. Marilyn wrote: Hello I created a user custom form with the help of Excel 2002 Visual Basic Book. My problem is that I created 2 command buttons in the user form, one a cancel button, and that is OK, the other is "Add customer" and that is where I am having problems, four hours of problem. Once the user form is completed and the "add customer " button is selected I want the information to go the the spreahsheet. How to I do this? Thanks -- Debra Dalgleish Contextures http://www.contextures.com/tiptech.html |
#4
Posted to microsoft.public.excel.misc
|
|||
|
|||
User form and Command button
Thank Debra This is perfect.
"Debra Dalgleish" wrote: There are instructions and sample file for a UserForm he http://www.contextures.com/xlUserForm02.html The 'Add this part' button sends the information to a worksheet. Marilyn wrote: Hello I created a user custom form with the help of Excel 2002 Visual Basic Book. My problem is that I created 2 command buttons in the user form, one a cancel button, and that is OK, the other is "Add customer" and that is where I am having problems, four hours of problem. Once the user form is completed and the "add customer " button is selected I want the information to go the the spreahsheet. How to I do this? Thanks -- Debra Dalgleish Contextures http://www.contextures.com/tiptech.html |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Command Button on User form for Printing | Excel Discussion (Misc queries) | |||
use a button to open a user form? | Excel Discussion (Misc queries) | |||
Open an Outlook folder when a user clicks on a command button ... | Excel Discussion (Misc queries) | |||
Command button on data-entry form | Excel Discussion (Misc queries) | |||
A "previous" button on a user form | Excel Discussion (Misc queries) |