Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
If I want to declare values String1 and String2 as strings can I use the
following:- Dim String1, String2 as String Or do I need Dim String1 as string, String2 as string? Ta Andi |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
The difference between your 2 statements;
Statement 1 - Only declares String2 as a string. String1 would be considered a Variant. Statement 2 - Declares both as a string. Not sure why this is the case, but I know that the first option doesn't initaiate an instance of the property for the 1st variable. HTH. "Andibevan" wrote: If I want to declare values String1 and String2 as strings can I use the following:- Dim String1, String2 as String Or do I need Dim String1 as string, String2 as string? Ta Andi |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
From XL/VBA Help ("Declaring Variables"):
You can declare several variables in one statement. To specify a data type, you must include the data type for each variable. In the following statement, the variables intX, intY, and intZ are declared as type Integer. Dim intX As Integer, intY As Integer, intZ As Integer In the following statement, intX and intY are declared as type Variant; only intZ is declared as type Integer. Dim intX, intY, intZ As Integer You don't have to supply the variable's data type in the declaration statement. If you omit the data type, the variable will be of type Variant. In article , "Andibevan" wrote: If I want to declare values String1 and String2 as strings can I use the following:- Dim String1, String2 as String Or do I need Dim String1 as string, String2 as string? Ta Andi |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Check out this link. It expains everything you wanted to know about variables
declarations but were affraid to ask... http://www.cpearson.com/excel/variables.htm -- HTH... Jim Thomlinson "Andibevan" wrote: If I want to declare values String1 and String2 as strings can I use the following:- Dim String1, String2 as String Or do I need Dim String1 as string, String2 as string? Ta Andi |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Ta
"Jim Thomlinson" wrote in message ... Check out this link. It expains everything you wanted to know about variables declarations but were affraid to ask... http://www.cpearson.com/excel/variables.htm -- HTH... Jim Thomlinson "Andibevan" wrote: If I want to declare values String1 and String2 as strings can I use the following:- Dim String1, String2 as String Or do I need Dim String1 as string, String2 as string? Ta Andi |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
IF formula-simple question; simple operator | Excel Discussion (Misc queries) | |||
simple vba question | Excel Discussion (Misc queries) | |||
Simple Simple Excel usage question | Excel Discussion (Misc queries) | |||
simple question, hopefully a simple answer! | Excel Programming | |||
Simple VBA question | Excel Programming |