ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Re-show userform after closing file - code help (https://www.excelbanter.com/excel-discussion-misc-queries/156965-re-show-userform-after-closing-file-code-help.html)

Gerry O

Re-show userform after closing file - code help
 
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!
--
Thanks,

Gerry O.

Jim Thomlinson

Re-show userform after closing file - code help
 
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.
--
HTH...

Jim Thomlinson


"Gerry O" wrote:

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!
--
Thanks,

Gerry O.


Dave Peterson

Re-show userform after closing file - code help
 
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



Jim Thomlinson wrote:

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.
--
HTH...

Jim Thomlinson

"Gerry O" wrote:

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!
--
Thanks,

Gerry O.


--

Dave Peterson

Gerry O

Re-show userform after closing file - code help
 
Thanks! That helped solve.
--
Thanks,

Gerry O.


"Jim Thomlinson" wrote:

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.
--
HTH...

Jim Thomlinson


"Gerry O" wrote:

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!
--
Thanks,

Gerry O.



All times are GMT +1. The time now is 05:48 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com