Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 211
Default 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   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3,942
Default 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   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,979
Default 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   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 211
Default 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
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
Command Button on User form for Printing Anthony Slater Excel Discussion (Misc queries) 2 September 7th 05 02:01 PM
use a button to open a user form? Hru48 Excel Discussion (Misc queries) 1 September 1st 05 07:41 PM
Open an Outlook folder when a user clicks on a command button ... Rob Keel Excel Discussion (Misc queries) 2 August 1st 05 08:23 AM
Command button on data-entry form Susy Excel Discussion (Misc queries) 1 February 15th 05 02:46 AM
A "previous" button on a user form Anthony Slater Excel Discussion (Misc queries) 3 November 29th 04 06:57 PM


All times are GMT +1. The time now is 06:19 PM.

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"