#### ErikG

##### New Member

I started having some trouble using the exponentiation operator "*" in VBA. The errors usually say that an end of statement is expected. So I created a simple UDF to illustrate my problem. The UDF just raises a given number to a given power or raises a given number to the second power. It looks something like this:

Code:

```
Public Function EXPO(a As Double) As Double
Dim b As Double
b = 2#
EXPO = a^b
End Function
OR
Public Function EXPO(a As Double, b As Double) As Double
EXPO = a^b
End Function
```

The errors I am getting back are Compile errors (either Expected: end of statement or Expected: )). I'm can't find examples of the exponentiation operator that are any more complex than "x = a^b". What am I missing? Many thanks in advance for your help!