简体   繁体   中英

Why can't an user-defined function take integer arguments and return integer?

The following user-defined function cannot be used in the worksheet. When I type

=Add2(1,1)

it returns #REF.

Function add2(x As Integer, y As Integer) As Integer
    add2 = x + y
End Function

If I change Integer to Double, only then it works. Why can't integer be used? Thank you.

问题就在这里,ADD2 也是一个范围,但是为什么将输出更改为双倍时它会起作用,我不知道。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM