ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Excel VBA Form problem (https://www.excelbanter.com/excel-programming/291898-excel-vba-form-problem.html)

Matt000

Excel VBA Form problem
 
ok this is for my a-level coursework... i have nearly completed it but i
wanted to make it a bit better by adding a custom form to let the user
make a selection.

Ok i have made my form and all the buttons on it and their functions
but i just cannot get the form to appear. I just want the form to
appear when i click on a button.

My form is called question and this is the code i am using to try and
run it:

Sub Question()
Question.Show
End Sub

I know it's completely wrong but i've never really used VB before and
the microsoft help is rubbish.
Please help!!


---
Message posted from http://www.ExcelForum.com/


Mark Rosenkrantz[_2_]

Excel VBA Form problem
 
Matt;

To overcome confusions, give your forms any name preceding with frm.
Don't give it the same name as the Procedure which is also called question.

So:

Private Sub frmQuestion_Show()
frmQuestion.Show
End Sub

Mark.

More Excel ? www.rosenkrantz.nl or
--------------------------------------------------------------------

"Matt000 " wrote in message
...
ok this is for my a-level coursework... i have nearly completed it but i
wanted to make it a bit better by adding a custom form to let the user
make a selection.

Ok i have made my form and all the buttons on it and their functions
but i just cannot get the form to appear. I just want the form to
appear when i click on a button.

My form is called question and this is the code i am using to try and
run it:

Sub Question()
Question.Show
End Sub

I know it's completely wrong but i've never really used VB before and
the microsoft help is rubbish.
Please help!!


---
Message posted from
http://www.ExcelForum.com/




Peter Atherton[_16_]

Excel VBA Form problem
 
Matt

The open form macro should also be in a general module and
not the form module. I presume you are going to assing a
button to the macro are you will also have to remove the
Private statement.

Regards
Peter
-----Original Message-----
Matt;

To overcome confusions, give your forms any name

preceding with frm.
Don't give it the same name as the Procedure which is

also called question.

So:

Private Sub frmQuestion_Show()
frmQuestion.Show
End Sub

Mark.

More Excel ? www.rosenkrantz.nl or


----------------------------------------------------------

----------

"Matt000 " wrote

in message
...
ok this is for my a-level coursework... i have nearly

completed it but i
wanted to make it a bit better by adding a custom form

to let the user
make a selection.

Ok i have made my form and all the buttons on it and

their functions
but i just cannot get the form to appear. I just want

the form to
appear when i click on a button.

My form is called question and this is the code i am

using to try and
run it:

Sub Question()
Question.Show
End Sub

I know it's completely wrong but i've never really used

VB before and
the microsoft help is rubbish.
Please help!!


---
Message posted from
http://www.ExcelForum.com/



.



All times are GMT +1. The time now is 01:48 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com