View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Niek Otten Niek Otten is offline
external usenet poster
 
Posts: 3,440
Default VBA Coding - any ideas why this UDFs not working?

Use MyStatus instead of Result

The Result syntax is not VBA

Niek Otten

"harpscardiff"
wrote in message
...

Function MyStatus(Status1 As Variant, Status2 As Variant)

If (Status1 = "n/a") And (Status2 = "n/a") Then
Result = "Authorised"

Else

If (Status1 = "n/a") And (Status2 < " ") Then
Result = "Misc"

Else

If (Status1 = "Pending") And (Status2 = "n/a") Then
Result = "Pending"

Else

If (Status1 = "Waiting Auth") And (Status2 = "n/a") Then
Result = "Pending"




End If
End If
End If
End If

Result = MyStatus


End Function

Mystatus invloved status1 and status2, which are lookup into different
sheets, basically if the lookup is #n/a then it brings back "n/a"

The result is coming back 0??

Any ideas? Thanks.


--
harpscardiff
------------------------------------------------------------------------
harpscardiff's Profile:
http://www.excelforum.com/member.php...o&userid=25960
View this thread: http://www.excelforum.com/showthread...hreadid=475038