LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
hdf hdf is offline
external usenet poster
 
Posts: 30
Default UDF won't launch macro

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
_________

 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Auto Launch of Macro Daren Excel Discussion (Misc queries) 1 March 20th 07 08:10 PM
VBA - Launch VBA Macro From VB ajocius[_54_] Excel Programming 2 May 18th 06 02:59 PM
Macro launch - Button vs Manual launch , has different results. Wayne Excel Programming 4 February 23rd 05 11:33 AM
Can you use an IF statement to launch a macro? ian123[_34_] Excel Programming 3 January 3rd 04 12:38 AM
Launch Macro in Access via Macro running in Excel??? dgrant Excel Programming 1 September 24th 03 01:38 PM


All times are GMT +1. The time now is 09:25 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"