A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Excel » General Discussion
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

How do you automatically display a vba form in excel 2007



 
 
Thread Tools Display Modes
  #1  
Old April 21st, 2010, 04:01 PM posted to microsoft.public.excel.misc
Kathryn
external usenet poster
 
Posts: 108
Default How do you automatically display a vba form in excel 2007

I have created a form in excel 2007 developer that manipulated data on two of
the sheets. Somehow I want the customer to be able to activate the form from
one of the sheets so they do not have to run it from developer. I tried to
create a macro but once the form activates you cannot stop the macro. I am
just learning the developer portion of this software so I you have any ideas
please share.

Thanks Much
  #2  
Old April 21st, 2010, 04:51 PM posted to microsoft.public.excel.misc
JLatham
external usenet poster
 
Posts: 1,896
Default How do you automatically display a vba form in excel 2007

Can we see the code you wrote?

Actually all that you need to open a UserForm is a one liner as:

Sub Button_Click()
userFormName.Show
End Sub

By default, UserForms are displayed as Modal. Meaning that they then take
control and their code is in use until they transfer control somehow, usually
somewhere within the UserForm you have a button that pretty much wraps it all
up as:

Sub CancelButton_Click()
Unload Me ' takes the userform completely out of memory
'or (and this wouldn't work with the Unload Me still in the code above)
Me.Hide ' removes it from view
End Sub

If you want the form to display and still have other processing continue,
set the form's Modal property to false. This is handy if you want to display
a form to show some progress indicator or such while the main code continues
to run and update the contents of the UserForm:

Sub DoALongProcess()
NotificationForm.Show
'code in here to do some long process
'with some content of the NotificationForm updated periodically
'during that processing, and then when it's all done
Unload NotificationForm
End Sub

"Kathryn" wrote:

I have created a form in excel 2007 developer that manipulated data on two of
the sheets. Somehow I want the customer to be able to activate the form from
one of the sheets so they do not have to run it from developer. I tried to
create a macro but once the form activates you cannot stop the macro. I am
just learning the developer portion of this software so I you have any ideas
please share.

Thanks Much

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 02:46 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.