Evaluating a named constant

B

Barb Reinhardt

I've done this before, but not in a while and can't find any examples.

I have a named constant I call QADDate in workbook aWB. How do I evaluate
the value of this in VBA?

Thanks,
Barb Reinhardt
 
B

Barb Reinhardt

That's not doing it Bernie. I'm getting

Run-time error 13
Type mismatch

Thanks,
Barb Reinhardt
 
B

Bernie Deitrick

Barb,

How did you define your named constant?

In code or as a name within the workbook:

Option Explicit
Const QADDate As Long = 4

Sub TryNow()
MsgBox QADDate
End Sub


The example that I gave was when creating a name...
 
B

Barb Reinhardt

It's a named constant (much like a named range). I've figured out how to
get to it, but still am interested in knowing how to evaluate named
constants.

Thanks,
Barb Reinhardt
 

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

Top