Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
HFB HFB is offline
external usenet poster
 
Posts: 17
Default Making a form into a file...

I'm using visual basic (the one that is part of Excel) to make a form for
people to fill out and print. How do I make it so I can open the form
without having to go ToolsMacrosVisual Basic Editor? (or is this a
function reserved for the complete version of VB?)
thanks
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 983
Default Making a form into a file...

Put a command button on a sheet and attach the following code to the button...

form1.show

You can get rid of the for using

unload me

or just hide the form with

form1.hide


HTH

"HFB" wrote:

I'm using visual basic (the one that is part of Excel) to make a form for
people to fill out and print. How do I make it so I can open the form
without having to go ToolsMacrosVisual Basic Editor? (or is this a
function reserved for the complete version of VB?)
thanks

  #3   Report Post  
Posted to microsoft.public.excel.programming
HFB HFB is offline
external usenet poster
 
Posts: 17
Default Making a form into a file...

Um. I can't even figure out how to attach code to a button in a worksheet.
You DO mean a worksheet?

"Jim Thomlinson" wrote:

Put a command button on a sheet and attach the following code to the button...

form1.show

You can get rid of the for using

unload me

or just hide the form with

form1.hide


HTH

"HFB" wrote:

I'm using visual basic (the one that is part of Excel) to make a form for
people to fill out and print. How do I make it so I can open the form
without having to go ToolsMacrosVisual Basic Editor? (or is this a
function reserved for the complete version of VB?)
thanks

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 983
Default Making a form into a file...

Ok... Here we go... In Excel right click on the toolbar at the top of the
page. You will get a list of Items with Check marks beside some of them...
Check "Control Toolbox"
and select OK. You will now have the Control Toolbox Toolbar. One of the
item on that toolbar looks like a Grey Button. Click on it. Your Cursor will
change to a Cross Hair. Now you need to select a spot on a work sheet and
click... Tada... You have now created a Command Button. Right click on the
button and select Properties. Change (Name) to cmdShowForm. Change Caption to
Show Form. Now right click on the button and Select View Code. Paste my code
into the code window.

Should look like this...

Private Sub cmdShowForm_Click()
Form1.Show
End Sub

Select the spread sheet again. On the Control Toolbax there is a button that
looks like a ruler triangle and pencil. Click it to exit the design mode. You
now have a button that will show the form... I hope...

HTH



"HFB" wrote:

Um. I can't even figure out how to attach code to a button in a worksheet.
You DO mean a worksheet?

"Jim Thomlinson" wrote:

Put a command button on a sheet and attach the following code to the button...

form1.show

You can get rid of the for using

unload me

or just hide the form with

form1.hide


HTH

"HFB" wrote:

I'm using visual basic (the one that is part of Excel) to make a form for
people to fill out and print. How do I make it so I can open the form
without having to go ToolsMacrosVisual Basic Editor? (or is this a
function reserved for the complete version of VB?)
thanks

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 983
Default Making a form into a file...

You are now ahead of a good chunk of Excel users in that you know that there
are 2 kinds of buttons...

Forms Toolbar buttons are good when you need a button that you can copy and
it will stay attached to its code. It attaches to a Macro. If you recorded a
macro in VB you would get a module. You can attach this kind of button to any
public sub in a module.

The Control Toolbox button is different in that it is embeded right in the
sheet. The code that is written for it is part of the sheet. This kind of
button does not copy well as it will not stay attached to it's code.

One button is not better htan the other. Depending on the situation they
both have merit.

HTH

"HFB" wrote:

Aha! I was trying to use a form command button rather than a control
toolboxy one :) Thanks heaps Jim

"Jim Thomlinson" wrote:

Ok... Here we go... In Excel right click on the toolbar at the top of the
page. You will get a list of Items with Check marks beside some of them...
Check "Control Toolbox"
and select OK. You will now have the Control Toolbox Toolbar. One of the
item on that toolbar looks like a Grey Button. Click on it. Your Cursor will
change to a Cross Hair. Now you need to select a spot on a work sheet and
click... Tada... You have now created a Command Button. Right click on the
button and select Properties. Change (Name) to cmdShowForm. Change Caption to
Show Form. Now right click on the button and Select View Code. Paste my code
into the code window.

Should look like this...

Private Sub cmdShowForm_Click()
Form1.Show
End Sub

Select the spread sheet again. On the Control Toolbax there is a button that
looks like a ruler triangle and pencil. Click it to exit the design mode. You
now have a button that will show the form... I hope...

HTH



"HFB" wrote:

Um. I can't even figure out how to attach code to a button in a worksheet.
You DO mean a worksheet?

"Jim Thomlinson" wrote:

Put a command button on a sheet and attach the following code to the button...

form1.show

You can get rid of the for using

unload me

or just hide the form with

form1.hide


HTH

"HFB" wrote:

I'm using visual basic (the one that is part of Excel) to make a form for
people to fill out and print. How do I make it so I can open the form
without having to go ToolsMacrosVisual Basic Editor? (or is this a
function reserved for the complete version of VB?)
thanks



  #6   Report Post  
Posted to microsoft.public.excel.programming
HFB HFB is offline
external usenet poster
 
Posts: 17
Default Making a form into a file...

Ooh, nice for the ego :) I think I'll stick with the Control Toolbox ones -
may be more work in the long run, but I'm more comfortable with actually
writing code rather than recording macros.... Either way, it works now which
is cool.

"Jim Thomlinson" wrote:

You are now ahead of a good chunk of Excel users in that you know that there
are 2 kinds of buttons...

Forms Toolbar buttons are good when you need a button that you can copy and
it will stay attached to its code. It attaches to a Macro. If you recorded a
macro in VB you would get a module. You can attach this kind of button to any
public sub in a module.

The Control Toolbox button is different in that it is embeded right in the
sheet. The code that is written for it is part of the sheet. This kind of
button does not copy well as it will not stay attached to it's code.

One button is not better htan the other. Depending on the situation they
both have merit.

HTH

"HFB" wrote:

Aha! I was trying to use a form command button rather than a control
toolboxy one :) Thanks heaps Jim

"Jim Thomlinson" wrote:

Ok... Here we go... In Excel right click on the toolbar at the top of the
page. You will get a list of Items with Check marks beside some of them...
Check "Control Toolbox"
and select OK. You will now have the Control Toolbox Toolbar. One of the
item on that toolbar looks like a Grey Button. Click on it. Your Cursor will
change to a Cross Hair. Now you need to select a spot on a work sheet and
click... Tada... You have now created a Command Button. Right click on the
button and select Properties. Change (Name) to cmdShowForm. Change Caption to
Show Form. Now right click on the button and Select View Code. Paste my code
into the code window.

Should look like this...

Private Sub cmdShowForm_Click()
Form1.Show
End Sub

Select the spread sheet again. On the Control Toolbax there is a button that
looks like a ruler triangle and pencil. Click it to exit the design mode. You
now have a button that will show the form... I hope...

HTH



"HFB" wrote:

Um. I can't even figure out how to attach code to a button in a worksheet.
You DO mean a worksheet?

"Jim Thomlinson" wrote:

Put a command button on a sheet and attach the following code to the button...

form1.show

You can get rid of the for using

unload me

or just hide the form with

form1.hide


HTH

"HFB" wrote:

I'm using visual basic (the one that is part of Excel) to make a form for
people to fill out and print. How do I make it so I can open the form
without having to go ToolsMacrosVisual Basic Editor? (or is this a
function reserved for the complete version of VB?)
thanks

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
Making a new XL file form the Original XL data - Misho Misho Excel Discussion (Misc queries) 3 September 25th 09 08:09 PM
Making a form visible [email protected] Excel Discussion (Misc queries) 3 March 11th 07 02:28 PM
HELP! Making A Form at_a_loss Excel Worksheet Functions 1 February 25th 06 11:17 AM
Making a new form Steven M. Britton Excel Discussion (Misc queries) 1 December 12th 04 09:09 PM
Making a form with only a certain amount of rows used Bob Reynolds[_2_] Excel Programming 5 November 30th 03 08:24 PM


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