Home |
Search |
Today's Posts |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() Robert Crandal;566072 Wrote: I have a push button on my spreadsheet which loads my Userform in the following manner: Sub Button1_Click() UserForm1.Show (vbModeless) ' Display my Userform End Sub When a user presses the "X" button on the Userform object I believe that Excel will terminate the Userform instead of simply "hiding" it by making it invisible. How can I program my Userform to turn invisible instead of terminating itself?? I would rather have the Userform turn invisible so it can maintain its current position on the screen when it is re-activated again..... I noticed that the Userform position gets reset to default after the form is terminated, and I want to avoid this. Thank you! To answer your original question, put this code in the user form's code modlue: Private Sub UserForm_QueryClose(Cancel As Integer, CloseMode As Integer) If CloseMode = 0 Then '(closemode = 0 means x in top right was clicked) Cancel = True Me.Hide End If End Sub The form still exists, controls values too, for when -.show- gets executed again -- p45cal *p45cal* ------------------------------------------------------------------------ p45cal's Profile: http://www.thecodecage.com/forumz/member.php?userid=558 View this thread: http://www.thecodecage.com/forumz/sh...d.php?t=156259 Microsoft Office Help |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Excel - Golf - how to display "-2" as "2 Under" or "4"as "+4" or "4 Over" in a calculation cell | Excel Discussion (Misc queries) | |||
change "true" and "false" to "availble" and "out of stock" | Excel Worksheet Functions | |||
How do display a "+" or "-" sign when hiding columns? | Setting up and Configuration of Excel | |||
Count occurences of "1"/"0" (or"TRUE"/"FALSE") in a row w. conditions in the next | New Users to Excel | |||
Excel 2000 crashes after "touching" a userform with the mouse and closing it | Excel Programming |