Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Forms, marcos, buttons?

In college I had an assignment that required me to create a button in a
worksheet that, when pressed, a form would come up where the user could input
information. I remember it had something to do with macros. Does anyone know
how to do this?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,049
Default Forms, marcos, buttons?

wow. I assume that you have a version of Excel?
go to the visual basic developement environment - ALT+F9
click Insert / Userform
this adds a basic userform with the default name, userform1
click Insert / Module
this opens a standard code module. Type (cut/paste) this into the module
SUB ShowTheForm()
userform1.Show
END SUB

go back to the spreadsheet
open the Forms menu and drag a button onto the worksheet - the Assign Macro
form opens automatically, select ShowTheForm and hit OK




"Lewej23" wrote in message
...
In college I had an assignment that required me to create a button in a
worksheet that, when pressed, a form would come up where the user could
input
information. I remember it had something to do with macros. Does anyone
know
how to do this?


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 140
Default Forms, marcos, buttons?

Here is the basics.

1. Create the button on a worksheet -
Access View:Toolbars:Forms to display the "Forms" toolbar.
Click on the "Button" tool.
Click and drag the pointer across a small part of your worksheet.
The button should now be on your worksheet.
2. Edit the text on the button by clicking on the botton you just made then
typing something like "Start" or "GO".
3. Startup the VBA editor.
4. Add a code module to the workbook.
5. In the project explorer, double-click on the module you added. Then type
in the following

Sub MyMacro()

response=inputbox("Enter some text or number here.", "My Input Box")

End Sub

6. Then go back to your button on the worksheet and right-click on it.
Select the "Assign Macro" from the popup menu.
7. Double-click on the macro "MyMacro" that should be displayed on the
list.

Your done!

Click on the button you made on the worksheet and see what happens.


Dennis

"Lewej23" wrote in message
...
In college I had an assignment that required me to create a button in a
worksheet that, when pressed, a form would come up where the user could
input
information. I remember it had something to do with macros. Does anyone
know
how to do this?


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
Marcos and buttons Jo Excel Programming 4 March 16th 09 02:00 PM
Forms Buttons on Sheet Frozen Corey Excel Programming 2 September 15th 08 10:06 PM
Forms buttons Trebor Retrac Excel Discussion (Misc queries) 3 September 11th 06 05:37 PM
Forms: Radio buttons Lowkey Excel Programming 3 August 4th 05 05:21 PM
buttons on forms Jabba Excel Programming 1 March 31st 05 10:25 PM


All times are GMT +1. The time now is 02:35 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"