Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 391
Default Basic UserForm question - please help

Not sure what you mean by wanting the form to stay up
while th e rest of the code runs...

I'll take a guess that your procedure is

....code1
userform1.Show
....code2

and you want code2 to run while the form is displayed.
This is a function of the MODAL state. By default, the
userform.Show method is modal
This means that code execution waits for the form to
close before continuing with code2. Force the form to
open in modeless state then code will continue event
while the form is showing

....code1
userform1.Show vbModeless
....code2

Patrick Molloy
Microsoft Excel MVP

-----Original Message-----
Please help if you can. In my Excel macro, Sheet 1

determines if value 1 is greater than value 2 and if so,
calls UserForm1. UserForm1 is a simple form, with some
text and an OK button. Clicking the OK button closes the
UserForm. So far, so good. When UserForm1 opens up, I
need it to stay on the screen until a user clicks the OK
button. While it is up, I need the rest of the macro to
function. If I highlight UserForm1 and view code, I get
my code:

Private Sub UserForm1_Activate()
MsgBox "This is a test - hello"
'Place code here that or call another sub rotine from

here
End Sub

Problem is, this refuses to show me the message box.

What I am doing wrong? Why won't the UserForm1_Activate()
work?

Doug
.

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
Basic question...sorry jen the runner Excel Worksheet Functions 11 September 18th 07 12:12 AM
Visual Basic System Error-Userform GENEF Excel Discussion (Misc queries) 1 December 22nd 04 05:05 PM
Too Basic A Question dave Excel Programming 6 October 26th 03 03:57 PM
Basic VBA question Henrik[_2_] Excel Programming 2 October 25th 03 12:23 AM
Basic Userform Controlsource question Kevin Excel Programming 0 August 7th 03 11:04 PM


All times are GMT +1. The time now is 07:57 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"