Forum Discussion

MichaelJSchulz's avatar
MichaelJSchulz
Copper Contributor
May 25, 2022

Discussion: Persisting variable values—Named ranges vs hidden sheet

Let's say you have a variable, the value of which is determined with VBA code during a particular event, and you want to use that resulting value in the code that is run during a separate event.

 

I have seen several times the idea of writing those values to a hidden sheet so that the values could easily be retrieved at another time.

 

What I have not seen suggested is creating a Named range and setting that equal to the value. 

 

What are the pros and cons of these approaches and are there any other approaches?

5 Replies

Resources