If you're going to declare multiple variables on one line, make sure each variable is specifically declared : Variable Declaration « Language Basics « VBA / Excel / Access / Word

Home
VBA / Excel / Access / Word
1.Access
2.Application
3.Data Type
4.Data Type Functions
5.Date Functions
6.Excel
7.File Path
8.Forms
9.Language Basics
10.Math Functions
11.Outlook
12.PowerPoint
13.String Functions
14.Windows API
15.Word
16.XML
VBA / Excel / Access / Word » Language Basics » Variable Declaration 




If you're going to declare multiple variables on one line, make sure each variable is specifically declared
 
Sub dSub()
    Dim intCounter As Integer, intAge As Integer, intWeight As Integer
End Sub

 
Related examples in the same category
1.Declaring Variables
2.To declare a variable in VBA use the Dim (short for Dimension) statement.
3.Variable declaration is required with Option Explicit and a module level variable (answer) is declared.
4.Forcing Declaration of Variables: Option Explicit
5.Variables can also be declared in the declarations section at the top of a module
java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.