keep variable value after code quits

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?
 
B

Bob Phillips

As long as next time is still within the same Excel session, create a public
variable and store it there.
 
D

Don Guillett

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
 
L

Luke M

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)
 
Top