ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   How do I write code to preserve variables values for future use. (https://www.excelbanter.com/excel-programming/347905-how-do-i-write-code-preserve-variables-values-future-use.html)

Paul

How do I write code to preserve variables values for future use.
 
Variables lose their values after the procedure is executed. How can on write
a code to store a value obtained from an inputb box within a code that can be
used next day when I run the code again. In other words, I would like to
retain the last value obtained and somehow keep it in the code for the next
execution of the code.

Frederick Chow

How do I write code to preserve variables values for future use.
 
Hi Paul,

Two approaches:

1. Store your values in a xlVeryHidden worksheet.

2. Use SaveSettings or GetSettings method to save and retrieve values from
the registry.

Frederick Chow
Hong Kong
"Paul" wrote in message
...
Variables lose their values after the procedure is executed. How can on
write
a code to store a value obtained from an inputb box within a code that can
be
used next day when I run the code again. In other words, I would like to
retain the last value obtained and somehow keep it in the code for the
next
execution of the code.




Don Guillett[_4_]

How do I write code to preserve variables values for future use.
 
You could always store it somewhere in the sheet or in named ranges in the
"variables" sheet which can be hidden.

--
Don Guillett
SalesAid Software

"Paul" wrote in message
...
Variables lose their values after the procedure is executed. How can on
write
a code to store a value obtained from an inputb box within a code that can
be
used next day when I run the code again. In other words, I would like to
retain the last value obtained and somehow keep it in the code for the
next
execution of the code.





All times are GMT +1. The time now is 05:42 PM.

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