View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Alex J Alex J is offline
external usenet poster
 
Posts: 85
Default Closing the Userform when macro is running

Jas,

You might want to try Userform1.Hide and/or DoEvents to make the form
display go away. Are you using a modeless form?

Alex J

"SuperJas" wrote in message
...
Hi Vasant,

Thanks for your tip. However, I've tried it and it still doesn't

unload/hide as I'd like.

I've pasted the "Unload Myform" line in the command-button code section.

When I run the code via the "Step-into" method, the userform does close, but
when I run it normally it doesn't...

So I'm thinking this might have something to do with the

"Application.Screenupdating=False" command. However, this line is below the
"Unload Myform" line, so I can't figure out what the problem is...

Thanks for your time!




----- Vasant Nanavati wrote: -----

Something like:

Unload UserForm1

should do it.

--

Vasant