Vincent
Vincent

Reputation: 54

How to retrieve public constants in Excel VBA

I am working on an large Excel VBA project that needs to output an monthly report. As such I have a number of variables that I need to change monthly and that appear a lot throughout my code. I know i can declare Public constants, however I am just not able to retrieve these in different modules.

So how do I solve this as flexibly and easily as possible/how can I retrieve public constants in different modules?

E.G how can i retrieve:

Public Const startWeekProjection As Integer = 1609

in another module?

Upvotes: 1

Views: 3486

Answers (1)

user4039065
user4039065

Reputation:

Put your const vars into the Declarations area of a module code sheet.

  declarations area

You can run MySub, MySecondSub or MyThirdSub and use the startWeekProjection const var.

Upvotes: 2

Related Questions