Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi all!
I'm writing a function with two arguments. This function is part of a module for the worksheet. I just can't make it work when inserting it into a spreadsheet cell. Can you help? Thanks. Frisk. Function Result(Value1 As Double, Value2 As Double) As Byte Select Case Value2 Case Value2 < (20 / 100) Result = 1 Case Value2 < (50 / 100) Result = 2 Case Value2 < (100 / 100) Result = 3 Case Value2 < (110 / 100) Result = 4 Case Value2 < (120 / 100) Result = 5 Case Else Select Case value1 Case value1 < 20 / 100 Result = 1 Case value1 < 50 / 100 Result = 2 Case value1 < 100 / 100 Result = 3 Case value1 < 110 / 100 Result = 4 Case value1 < 120 / 100 Result = 5 Case Else Result = 0 End Select End Select End Function |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Frisk,
'Result' is the name of an XL4 Macro function. Change the name of the function to something else. "Frisk" wrote in message ... Hi all! I'm writing a function with two arguments. This function is part of a module for the worksheet. I just can't make it work when inserting it into a spreadsheet cell. Can you help? Thanks. Frisk. Function Result(Value1 As Double, Value2 As Double) As Byte Select Case Value2 Case Value2 < (20 / 100) Result = 1 Case Value2 < (50 / 100) Result = 2 Case Value2 < (100 / 100) Result = 3 Case Value2 < (110 / 100) Result = 4 Case Value2 < (120 / 100) Result = 5 Case Else Select Case value1 Case value1 < 20 / 100 Result = 1 Case value1 < 50 / 100 Result = 2 Case value1 < 100 / 100 Result = 3 Case value1 < 110 / 100 Result = 4 Case value1 < 120 / 100 Result = 5 Case Else Result = 0 End Select End Select End Function |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
User Defined Function returning #Value! | Excel Worksheet Functions | |||
Excel Average function not returning expected result | Excel Worksheet Functions | |||
Average function not returning expected result | Excel Discussion (Misc queries) | |||
IF function returning incorrect result | Excel Worksheet Functions | |||
User function for returning several results | Excel Programming |