Re-show userform after closing file - code help

G

Guest

Need a little help with some code. In one file, I have a userform with a
drop-down combobox from which a user selects an existing file to open. After
the file is opened, the userform is hid using me.hide. After making updates
to the file opened using the form, I need code to save the changes and
re-show the userform in the original file so the user can make another
selection or exit the userform.

Your help would be greatly appreciated!
 
G

Guest

A little hard to comment without seeing any code however in general (assuming
you are not using workbook objects)

ActiveWorkbook.Save 'Saves the currently acitve book
UserForm1.Show 'shows the userform that you hid
ThisWorkbook.Activate 'brings back the workbbok running the code...

Note that if the code is all being run from the userform you could use

Me.Show to bring back the userform.
 
D

Dave Peterson

I'd swap those last two:

ActiveWorkbook.Save 'Saves the currently acitve book
ThisWorkbook.Activate 'brings back the workbbok running the code...
UserForm1.Show 'shows the userform that you hid
 

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