I feel foolish for asking and I'm sure there's a simple answer. I'm trying to get a power for a number as follows: Sub test() Dim number As Long number = 2^8 ' Expect to get 256 here End Sub This
I think I got the point.
It seems in vba 2^2 is different with 2 ^ 2
So I must add the space manually. 2+2 will be changed to 2 + 2 as soon as I move to another line.
But 2^2 throws the error until the space is added manually.
I have 32bit. I've got a VM with 64bit I can fire up if you need it tested there. Funny as I copy/pasted your line of code and the spaces got added automatically. I tried taking them out and as soon as I left the line they returned.
If I type for example Sqr(a ^ 2 + b ^ 2) there is no error. But when I type Sqr(a ^ 2 + b^ 2) it produces a compile error which I do not understand: What is the function of ^ in VBA7 as opposed to...