Book Home Page Bloglines 1906 CelebrateStadium 2006 OfficeZealot Scobleizer TechRepublic AskWoody SpyJournal Computers Software Microsoft Windows Excel FrontPage PowerPoint Outlook Word ![]() ![]() Host your Web site with PureHost! ![]() |
![]() ![]() Saturday, September 12, 2009 – Permalink – Declaring Multiple VariablesDeclare each oneWhen setting up a macro in VBA, if you want to declare multiple variables in one line of code, be sure to specify the type for each variable, even if the variables are the same type. Avoid code like the following: Dim strFName, strLName, strMI As String In such a case, only the last variable, strMI, is actually declared as a String type. The first two variables are designated by default as Variant data types. To correctly declare the three variables, you would use the statement: Dim strFName As String, strLName As String, strMI As String See all Topics excel Labels: VBA <Doug Klippert@ 6:47 AM
Comments:
Post a Comment
|