Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Problems creating my own ifmacro function
Hi, I made a cutom function but it's not working (the #Value error is shown),
i attached the code so you can see it: Public Function ifmacro(m0 As String, m1 As String, m2 As String, m3 As String) As String If m0 = m1 Then DoCmd.RunMacro m2 Else DoCmd.RunMacro m3 End If End Function as you can see if I put in cell A7 the following text "=ifmacro(A1;A2;"Macro1";"Macro2")" and the values of A1=3 and A2=3 then A1=A2 so Macro1 should be executed, but this not happend, the #value error appears instead. questions: 1) Why my function is not working??? 2)How to change The m0 and m1 variables to just one (like the if function "=if(A1=A2;....................................... .)")????? TIA. |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Problems creating a result based on 2 cells being true.. | Excel Worksheet Functions | |||
Problems Creating and Saving Add-in | Setting up and Configuration of Excel | |||
Having problems creating a cube | Excel Worksheet Functions | |||
I am having problems creating pivot table of data | Charts and Charting in Excel | |||
Problems creating a chart with VBA | Excel Programming |