Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I apologize for the naive question but I cannot seem to find documentation
(even on McRitchie's) on how to create a User Defined Function with a return value. Pls complete the following code... Public Sub aaaaa if itemcheck()=true then msgbox("ok") else msgbox("not ok") endif Public function itemcheck if blahblah=soso then return_value=true else return_value=false endif end function What do I have to add to the function so that it defines the return_value and returns it to the calling subroutine; Thanks for your patience |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Public function itemcheck
if blahblah=soso then itemcheck=true else itemcheck=false endif end function Regards, Stefi €˛DoctorG€¯ ezt Ć*rta: I apologize for the naive question but I cannot seem to find documentation (even on McRitchie's) on how to create a User Defined Function with a return value. Pls complete the following code... Public Sub aaaaa if itemcheck()=true then msgbox("ok") else msgbox("not ok") endif Public function itemcheck if blahblah=soso then return_value=true else return_value=false endif end function What do I have to add to the function so that it defines the return_value and returns it to the calling subroutine; Thanks for your patience |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
One of the not so nice things in VB (IMO). The function name is the return
value, so in your case you must add itemcheck=return_value or code it to set that inline. -- HTH Bob Phillips "DoctorG" wrote in message ... I apologize for the naive question but I cannot seem to find documentation (even on McRitchie's) on how to create a User Defined Function with a return value. Pls complete the following code... Public Sub aaaaa if itemcheck()=true then msgbox("ok") else msgbox("not ok") endif Public function itemcheck if blahblah=soso then return_value=true else return_value=false endif end function What do I have to add to the function so that it defines the return_value and returns it to the calling subroutine; Thanks for your patience |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thank you both!!
|
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Help and description for UDFs | Excel Worksheet Functions | |||
VBA, UDFs and VSTO | Excel Programming | |||
UDFs: A simple question. | Excel Programming | |||
'portable' UDFs??? | Excel Programming | |||
Acrobat 6.0 and UDFs | Excel Programming |