Vba global variable declaration

In vba how to declare a global variable, which will be assigned from userform, but then used inside various sub procedures, functions in different modules? Declaration of var (dim) above in module does not let from other modules to call the value of variable


You need to declare the variable on top of the first module you are using (outside subs and functions) and add the Option Explicit line above, like this :

Option Explicit

Public (Variable Name) As (Variable Type)

EDIT : Since I can't comment under your answer I'll try my best here. If I understand right you have a "main" module where you do all your procedures and one userform where you gather data. Then initialize a public variable on top of the "main" module and use it in your userform.