ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Evaluating a named constant (https://www.excelbanter.com/excel-programming/422763-re-evaluating-named-constant.html)

Bob Phillips[_3_]

Evaluating a named constant
 
application.evaluate(activeworkbook.Names("Bob").R efersTo)

--
__________________________________
HTH

Bob

"Barb Reinhardt" wrote in message
...
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


"Bernie Deitrick" wrote:

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...

--
HTH,
Bernie
MS Excel MVP


"Barb Reinhardt" wrote in
message
...
That's not doing it Bernie. I'm getting

Run-time error 13
Type mismatch

Thanks,
Barb Reinhardt

"Bernie Deitrick" wrote:

Barb,

MsgBox Evaluate("QADDate")

HTH,
Bernie
MS Excel MVP


"Barb Reinhardt" wrote in
message
...
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











All times are GMT +1. The time now is 11:47 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com