Link to home
Create AccountLog in
Avatar of Moiz Saifuddin
Moiz Saifuddin

asked on

color defined globally vba

How do I set global variable in my Excel vba project and how can I call it from any module,sheet,form or class.

Is Gobalscope a term associated with setting these variables. Can I define an entire function globally? Please post an example if possible.

The project is to store or call colors defined in the vba proj (chart creation)that can be defined globally in a page so I dont have to change them on each page individually and can alter them in one location itself.
ASKER CERTIFIED SOLUTION
Avatar of Andy Marshall
Andy Marshall
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account
Here is a sample.
4.zip
Avatar of Martin Liss
Note that depending on what version of VBA you're using you may not be able to do this:

Public gstrApplicationName As String = "My Application"

and you may have to do the following instead

Public gstrApplicationName As String
gstrApplicationName = "My Application"