View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Chip Pearson Chip Pearson is offline
external usenet poster
 
Posts: 7,247
Default user-function not returning any result (newbye)

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