Understanding Module-Level Variables : Variable Scope « Language Basics « VBA / Excel / Access / Word






Understanding Module-Level Variables

 
Sub ExpenseRep()
          Dim slsPrice As Currency
          Dim cost As Currency
      
          slsPrice = 55.99
          cost = slsPrice + (slsPrice * slsTax)
      
          MsgBox slsTax
          MsgBox cost
End Sub

 








Related examples in the same category

1.Local variable
2.Procedure-Level (Local) Variables
3.module-level variable declared with Private statement
4.Public Variables
5.Understanding and Using Static Variables
6.sub module scope
7.Module level variable
8.Local variables are available only in the procedure where they are declared
9.Private module variable