Thread
:
UDF won't launch macro
View Single Post
#
2
Posted to microsoft.public.excel.programming
tissot.emmanuel
external usenet poster
Posts: 18
UDF won't launch macro
Hi,
Don't spend time in trying to do that, it's impossible. The purpose of an
UDF is to return a value to the calling cell, nothing else, anyway you try.
Best regards from France,
Manu/
"hdf" a écrit dans le message de news:
...
I have created a simple User Defined Function that I had hoped would
launch a specific macro depending on whether the value in a given cell
using the UDF was True or False.
It is not working, so I'm obviously doing something wrong.
When the value the UDF is linked to is FALSE, the UDF cell puts in the
value "0" (which is fine for my needs). But when the value is linked
to the formula is TRUE, the UDF cell gives back the #Value! error and
it does not call the macro I want it to call.
Can someone help explain what I'm doing wrong? Following is the UDF
code I used.
_________
Function LaunchMacro (InputValue As Boolean)
If InputValue = True Then
Application.Run "NamedMacro"
Else
Exit Function
End If
End Function
_________
Reply With Quote
tissot.emmanuel
View Public Profile
Find all posts by tissot.emmanuel