Skip to content

Instantly share code, notes, and snippets.

@erajanraja24
Created June 21, 2016 16:11
Show Gist options
  • Save erajanraja24/834428f2c534fac9c16a4cc4d7ed4ee5 to your computer and use it in GitHub Desktop.
Save erajanraja24/834428f2c534fac9c16a4cc4d7ed4ee5 to your computer and use it in GitHub Desktop.
Excel VBA Scope of variables
Dim var1 As Integer
Sub Module_Scope_1()
var1 = 20
Debug.Print "Value of var1 in Module_Scope_1: "; var1
var1 = var1 + 15
End Sub
Sub Module_Scope_2()
Debug.Print "Value of var1 in Module_Scope_2: "; var1
End Sub
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment