Disable the Close button on a Userform

M

Moh

how do i disable the close button on my userform?
or can i just remove it?

and when the user clicks cancel... is there a way to direct the user back to
sheet1 ?

Cheers
--
 
C

Carim

Hi,

Private Sub UserForm_QueryClose(Cancel As Integer, CloseMode As
Integer)
If CloseMode = vbFormControlMenu Then
' make user do what you want"
Cancel = True
End If
End Sub

HTH
 
M

merjet

What exactly do you mean by "it doesn't work"?

Maybe you need to add a Command Button with
the following code:

Private Sub CommandButton1_Click()
Sheet1.Activate
Unload Me
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top