and it says -7, not 7
Why?
--
jake
Because in VBA TRUE = -1, while in Excel TRUE = 1, so when you write t=1 its
TRUE and than you multiply TRUE (i.e. -1) times 7...
--
Hope I helped you.
Thanks in advance for your feedback.
Ciao
Franz Verga from Italy
t2 = (t * 7)
is all you need
--
Gary
"Jakobshavn Isbrae" <Jakobsha...@discussions.microsoft.com> wrote in
message news:7F12D31B-9960-405F...@microsoft.com...
This one gives 7.
Sub macro()
Dim t As Integer
Dim t2 As Integer
t = 1
t2 = t * 7
MsgBox (t2)
End Sub
"Jakobshavn Isbrae" <Jakobsha...@discussions.microsoft.com> schreef in
bericht news:7F12D31B-9960-405F...@microsoft.com...
From VBA HELP:
"When Boolean values are converted to other data types, False becomes 0 and
True becomes -1."
So your formula reduces to:
t2 = -1 * 7
t2 = -7
--ron
I did not know the booleans had different number values in VBA.
Thanks again
--
jake