How to unload a form

G

Guest

Hi everyone

I have a form in Excel VBA and I need it to unload when I hit the cancel
button. I tried several things and none seem to work properly.

Can anyone help me?

Thanks in advance

Suzanne
 
P

paul.robinson

Hi
double click the Cancel button inside the Editor and you get

Private Sub Button1_Click()

End sub

or similar. Change this to

Private Sub Button1_Click()
Unload Me
End sub

regards
Paul
 

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