JC_Lives
asked on
Excel VBA - declaring a constant as a value that is subject to change
Hi,
I am having a really funny issue with a variable changing by itself. I think it happens when I modify code near the declaration of that variable: then it resets to zero because VBA thinks I just declared it or something. I wanted to declare a constant as a value that could change later, but I want the constant to stay the same. I want to use a counta function on a range to do that... but I can't seem to use counta in the constant declaration section. Is there any way to freeze a variable's value, even if something attempts to change it later?
Thanks!
I am having a really funny issue with a variable changing by itself. I think it happens when I modify code near the declaration of that variable: then it resets to zero because VBA thinks I just declared it or something. I wanted to declare a constant as a value that could change later, but I want the constant to stay the same. I want to use a counta function on a range to do that... but I can't seem to use counta in the constant declaration section. Is there any way to freeze a variable's value, even if something attempts to change it later?
Thanks!
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Ok great, thanks guys!
ASKER
Book1.xls