ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   VB user forms (https://www.excelbanter.com/excel-programming/287536-vbulletin-user-forms.html)

Madasu

VB user forms
 
Hi all,

I started to play with user forms in visual basic. One thing lead to
another and with overwhelming excitement I created my first form. Having
spent all that time I cannot now fathom out how to launch that form whilst
in the excel spread sheet.

I assume that one way would be through a macro button. Does anyone know the
macro code that would be needed to launch a selected user form.

Thanks for any available help or helpful links that I have failed to find


--
Mad

polletje[_12_]

VB user forms
 
If I understand you well, it is very simple. Just put the followin
macro in your vba-module and replace FormName for the name of you
form.

Sub OpenForm()
FormName.Show
End Sub


You can add the macro to a button or menu

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


Madasu

VB user forms
 
On Sun, 11 Jan 2004 15:30:51 -0600, polletje wrote:

If I understand you well, it is very simple. Just put the following
macro in your vba-module and replace FormName for the name of your
form.

Sub OpenForm()
FormName.Show
End Sub


I think you understand me polletje. Thanks for the reply. When I create a
macro button and view code I see the following

Private Sub CommandButton1_Click()

End Sub

With the curser in between the two commands.

I have played with your lines but I can't get it to work. I'm sure it's
simple and if I could learn to walk before I ran I would avoid these
situations. Any further help would be appreciated.

--
Mad

Yakimo[_2_]

VB user forms
 
You should use Show method of a user form like this:

Private Sub CommandButton1_Click()
UserForm1.Show
End Sub


"Madasu" wrote in message
...
On Sun, 11 Jan 2004 15:30:51 -0600, polletje wrote:

If I understand you well, it is very simple. Just put the following
macro in your vba-module and replace FormName for the name of your
form.

Sub OpenForm()
FormName.Show
End Sub


I think you understand me polletje. Thanks for the reply. When I create

a
macro button and view code I see the following

Private Sub CommandButton1_Click()

End Sub

With the curser in between the two commands.

I have played with your lines but I can't get it to work. I'm sure it's
simple and if I could learn to walk before I ran I would avoid these
situations. Any further help would be appreciated.

--
Mad




Madasu

VB user forms
 
On Sun, 11 Jan 2004 23:33:04 +0100, Yakimo wrote:

You should use Show method of a user form like this:

Private Sub CommandButton1_Click()
UserForm1.Show
End Sub



Thanks Yakimo.
That did the trick.
--
Mad


All times are GMT +1. The time now is 12:13 PM.

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