Thread: Named Constant
View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Jim Thomlinson Jim Thomlinson is offline
external usenet poster
 
Posts: 5,939
Default Named Constant

A constant cannot be changed. That is the whole point to a constant. The
value remains constant no matter what. As a guess you are looking for a
global variable???

So instead of
Const MyVar as String = "On"
you want
Public MyVar as String

By default the string will be empty. You will need to initialize it prior to
using it.
--
HTH...

Jim Thomlinson


"Shatin" wrote:

Hi All,

If I have a named constant in a certain worksheet called "Status" whose
inital value is "On". What's the vba code for:

- finding out what the value of this named constant is?
- changing the value to "Off" if the value is "On"?

TIA