Home |
Search |
Today's Posts |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
From the Excel help file (edited):
'-- The #NAME? error value occurs when Microsoft Excel doesn't recognize text in a formula. Possible causes... Deleting a name used in the formula, or using a name that does not exist. Misspelling the name. Misspelling the name of a function. Entering text in a formula without enclosing the text in double quotation marks. Omitting a colon (:) in a range reference. '-- Also, the code should be in a standard/regular module and you might want it to look more like this... Function Commission(ByRef Fee As Variant) As Variant If TypeName(Fee) < "Double" Then Commission = "Bad Data" ElseIf Fee <= 45 Then Commission = 15 Else Commission = Fee * 0.35 End If End Function -- Jim Cone Portland, Oregon USA "Rick" wrote in message It's a simple function, so far: Function Commission(Fee) If Fee = 45 Then Commission = 15 Else Commission = Fee * 0.35 End Function I've named my ranges and the function is in VBAProject | Modules. I'm at a loss. |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
IF function returns function statement rather than result | Excel Worksheet Functions | |||
Function returns #Name? | Excel Programming | |||
INT Function Returns 1 | Excel Worksheet Functions | |||
VBA function returns #NAME? | Excel Programming | |||
Function returns a zero value | Excel Programming |