Reputation: 1147
Is there a clever way of storing variables globally so that you can call them at any of the modules at anytime?
Example
Dim pwd As String
pwd = "password"
Private Sub Test()
MsgBox (pwd)
End Sub
Thanks
Upvotes: 0
Views: 271
Reputation: 2696
Your example is a constant.
Public Const pwd as String = "password"
Declare it on top of a standard module.
For other solutions with subs, functions or properties look at the Related-Section on the right side of the page.
Upvotes: 2
Reputation: 92
Global pwd As String
inside of a module-level module (not a sheet-level module).
Upvotes: 0