Question: I have several Sub's in my Module. I would like to set variable that I can use in all Subs below. How to do that? 

Let's say variable is a text from `ThisWorkbook.Worksheets("Sheet1").Range("E1").Value` and its name should be `FileNameINVREQ`

How to implement that in the code? I have tried:

```
Option Explicit

Const FileNameINVREQ As String = ThisWorkbook.Worksheets("Sheet1").Range("E1").Value

Private Sub CreateNewINVREQtoMFiles()

            ...
            ' PD Name Or title.
            oPVNew.PropertyDef = 0
            oPVNew.TypedValue.SetValue MFDatatypeText, FileNameINVREQ
            oPVsNew.Add -1, oPVNew
            ...
End Sub
Private Sub CreateINVREQtoMFiles()

        ...
        oFile.SourceFilePath = Environ("Temp") & "\" & FileNameINVREQ & ".docx"
        oFile.Title = FileNameINVREQ
        oFile.extension = "docx"
        oFiles.Add 0, oFile
        ...
End Sub

```

Answer: 
A constant means it cannot be changed. For a variable, taking data from a cell, accessible from everywhere a public function without arguments would do the job:

```
Public Function FileNameINVREQ() As Variant
    FileNameINVREQ = ThisWorkbook.Worksheets("Sheet1").Range("E1").Value
End Function

```
Pulling a value from a worksheet is technically not a constant (since the value could change) so you'll need to use a variable instead. However, while you can declare variables as global, you can't set them outside of a sub or function.

My suggestion would be to move both the declaration and setting the value to its own subroutine that you reference when you need to know the value.

```
Global FileNameINVREQ as string

Sub FileName()
  FileNameINVREQ = ThisWorkbook.Worksheets("Sheet1").Range("E1").Value
End Sub

```

Going a step further, you could scrap it as a variable entirely and just change that FileName sub to a function! Hopefully one of these solutions works for you!