Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
I have a workbook that uses the ISEVEN function. Since some people who use
the workbook may not have ATP installed, I decided to try writing my own MyIsEven function. It gives the same result as ISEVEN on all of the test entries I tried, except for numbers greater than 2,147,483,647. Function MyIsEven(Num As Long) As Boolean Select Case Right (Num, 1) Case 0, 2, 4, 6, 8 MyIsEven = True Case Else MyIsEven = False End Select End Function I thought of adding an If statement to deal with the large numbers, but it didn't make any difference: If Num 2147483647 Then Num = Num - 2147483646 End If I also thought of using MyIsEven(Num As Double), but that introduces different errors. For my workbook, what I have will work fine, but I thought I would try to be as thorough as possible. |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Help with creating a function | Excel Worksheet Functions | |||
Need help creating a function | Excel Worksheet Functions | |||
Creating a Function | Excel Worksheet Functions | |||
Creating a function | Excel Worksheet Functions | |||
creating a function | Excel Discussion (Misc queries) |