I wrote a user-defined function in Excel 2016 for Mac. The function itself works; I called it within VBA in a new Subroutine and it worked fine. But when I call it from the sheet, it does nothing.
Function isMultipleOf5(myInput As Integer) As Boolean
Dim result As Double
result = myInput Mod 5
If result = 0 Then
isMultipleOf5 = True
Else
isMultipleOf5 = False
End If
End Function
It turns out I was placing the code under "Microsoft Excel Objects", and putting the code in ThisWorkbook or Sheet1 doesn't allow the function to work. Instead, you must right-click on Microsoft Excel Objects -> Insert -> Module -> place the code in the new blank area.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With