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

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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.
 
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
 
You could always store it somewhere in the sheet or in named ranges in the
"variables" sheet which can be hidden.
 

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

Back
Top