ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   make userform textbox value permanent (https://www.excelbanter.com/excel-programming/427650-make-userform-textbox-value-permanent.html)

Matt S

make userform textbox value permanent
 
Hi all,

I am creating a userform for a colleague. One of my textboxes outputs the
directory that is selected to save the file after the macro is complete. I
have also given the user a checkbox that will hopefully make the directory to
save a "permanent" value so that the next time he opens the file, that
directory is preselected automatically. It will be permanent unless he
selects another directory and makes the checkbox true again later.

I have tried saving the UserForm1.Textbox9.Value equal to itself, but that
doesn't change the value I assign it in the userform after I close the file
and open it again.

Any help would be appreciated!

Thanks!
Matt

Rick Rothstein

make userform textbox value permanent
 
VB controls do not save their information... you have to do that yourself.
You can output the value to a text file or save it in a cell on a worksheet
somewhere when the workbook closes and then load it back in when the
UserForm loads up (if you go with the cell idea, you can delete the cell's
content after your UserForm retrieves the value.

--
Rick (MVP - Excel)


"Matt S" wrote in message
...
Hi all,

I am creating a userform for a colleague. One of my textboxes outputs the
directory that is selected to save the file after the macro is complete.
I
have also given the user a checkbox that will hopefully make the directory
to
save a "permanent" value so that the next time he opens the file, that
directory is preselected automatically. It will be permanent unless he
selects another directory and makes the checkbox true again later.

I have tried saving the UserForm1.Textbox9.Value equal to itself, but that
doesn't change the value I assign it in the userform after I close the
file
and open it again.

Any help would be appreciated!

Thanks!
Matt



Matt S

make userform textbox value permanent
 
Thanks Rick. I know I can type in a value in the text box when editing the
userform and this makes it permanent. I will go with the cell idea, though
so it can be changed.

Thanks again,
Matt

"Rick Rothstein" wrote:

VB controls do not save their information... you have to do that yourself.
You can output the value to a text file or save it in a cell on a worksheet
somewhere when the workbook closes and then load it back in when the
UserForm loads up (if you go with the cell idea, you can delete the cell's
content after your UserForm retrieves the value.

--
Rick (MVP - Excel)


"Matt S" wrote in message
...
Hi all,

I am creating a userform for a colleague. One of my textboxes outputs the
directory that is selected to save the file after the macro is complete.
I
have also given the user a checkbox that will hopefully make the directory
to
save a "permanent" value so that the next time he opens the file, that
directory is preselected automatically. It will be permanent unless he
selects another directory and makes the checkbox true again later.

I have tried saving the UserForm1.Textbox9.Value equal to itself, but that
doesn't change the value I assign it in the userform after I close the
file
and open it again.

Any help would be appreciated!

Thanks!
Matt




Rick Rothstein

make userform textbox value permanent
 
I know I can type in a value in the text box when editing
then userform and this makes it permanent.


That works because it is a design-time setting (like the font color, or back
color, etc.)... you can change these at run-time but those changes won't
stick.

--
Rick (MVP - Excel)


"Matt S" wrote in message
...
Thanks Rick. I know I can type in a value in the text box when editing
the
userform and this makes it permanent. I will go with the cell idea,
though
so it can be changed.

Thanks again,
Matt

"Rick Rothstein" wrote:

VB controls do not save their information... you have to do that
yourself.
You can output the value to a text file or save it in a cell on a
worksheet
somewhere when the workbook closes and then load it back in when the
UserForm loads up (if you go with the cell idea, you can delete the
cell's
content after your UserForm retrieves the value.

--
Rick (MVP - Excel)


"Matt S" wrote in message
...
Hi all,

I am creating a userform for a colleague. One of my textboxes outputs
the
directory that is selected to save the file after the macro is
complete.
I
have also given the user a checkbox that will hopefully make the
directory
to
save a "permanent" value so that the next time he opens the file, that
directory is preselected automatically. It will be permanent unless he
selects another directory and makes the checkbox true again later.

I have tried saving the UserForm1.Textbox9.Value equal to itself, but
that
doesn't change the value I assign it in the userform after I close the
file
and open it again.

Any help would be appreciated!

Thanks!
Matt






All times are GMT +1. The time now is 12:18 AM.

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