Thread
:
declare type and value on one line?
View Single Post
#
1
Posted to microsoft.public.excel.programming
Chip Pearson
external usenet poster
Posts: 7,247
declare type and value on one line?
Jamie,
You can't initialize a variable in its declaration. The closest you can get
is to use the ":" character to put two logical lines of code on one actual
line of text. E.g.,
Dim sexy As Boolean : sexy = True
--
Cordially,
Chip Pearson
Microsoft MVP - Excel
www.cpearson.com
"Jamie Martin" wrote in message
...
Can I declare the type and the value of a variable on one line, such as
Dim sexy As Boolean = True
?
Also, can I do a two-condition test, like
If (catsLoveDogs = True) && (dogsLoveCats = False) Then
MsgBox("All is right with the world.")
End If
?
Reply With Quote
Chip Pearson
View Public Profile
Find all posts by Chip Pearson