keep variable value after code quits

  • Thread starter Thread starter Steve
  • Start date Start date
S

Steve

If I have code that prompts the user for some sort of input, is it possible
to have store the value of the variable so the next time the macro runs, it's
available?
 
As long as next time is still within the same Excel session, create a public
variable and store it there.
 
Store it in a public variable, or, if you want it the next time you open, a
cell

public savethis
sub()
ddd
savethis="OK"
end sub
 
If its a continuous segment of code, or one macro jumping to another yes.
Otherwise, I'd have the code write the value to a cell somewhere, and then
refer to that cell. (maybe do an if blank check or something)
 

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