Command buttons and text boxes..

uk-James

New Member
Joined
Mar 4, 2002
Messages
1
I'm trying to create a form that a user inputs some data (for instance - name, userid, staff position) and then use a command button to send the data to another sheet to form a table (a database basically). I'm aware of the form option under the data menu, but wondered whether its possible to create a form with button to do the process instead.
This message was edited by uk-james on 2002-03-05 09:43
 

Excel Facts

Can a formula spear through sheets?
Use =SUM(January:December!E7) to sum E7 on all of the sheets from January through December
Ooof, now you're talking :).

To create a userform, go into the VBA editor (right-click on any sheet tab and select view code). From the editor menu choose Insert and then UserForm. This will give you a blank form and (should, if not press View and Toolbox) show the UserForm toolbox. Select which controls you want and 'draw' them onto the form (probably a few text boxes and a command button for your purposes). Double click on the command button once it's on the form, and this will set up an event subroutine for you. The code you write in there will occur once you press the command button. To run the userform, just press F5.

There's plenty of code examples on this site (use the search function), and the help files for VBA are pretty extensive, just select what you want to know about and press F1. If you get into difficulties with a specific thing, just post your question here, there's loads of extremely knowledgeable (much more so than me :))people willing to help you out. Hope this gets you started OK and good luck.
This message was edited by Mudface on 2002-03-05 10:43
 
Upvote 0
How do you send the data (that you filled into the text boxes) to go to the table/database that is located on the excel sheet. Cos it needs to be able to create a new record each time you use the form, rather than overwriting itself each time. I've looked under this site's main search engine and the forum's serach engine to no avail. mucho help needed :)
 
Upvote 0
the way that i did this was to,
1. create a copy of the titles of the database in another location

2. send the details under these headings

3. create a dummy value above the first column of the headings on the main database

4. then record a macro to copy these details, then click on the dummy cell,

5. switch to relative referencing, press ctrl+down and then down once,switch back to absolute referencing

6. Paste special and choose 'values'. then stop recording

Your new details should be below the existing ones.
 
Upvote 0

Forum statistics

Threads
1,214,636
Messages
6,120,664
Members
448,976
Latest member
sweeberry

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