View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default declare type and value on one line?

You can do the first, only as a constant:

Const Sexy As Boolean = True

AND is the conjunction operator
OR is the disjunction operator

If (catsLoveDogs = True) AND (dogsLoveCats = False) Then

--
Regards,
Tom Ogilvy


"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

?