I have written macros before but this built-in function is evading me!
I have simplified my problem in the following code:
Code:
Function print_name(p_name)
ActiveSheet.Range("h1").Value = p_name
print_name = p_name
End Function
If I run this simple function using a macro, it works!
Code:
Sub test1()
print_name ("Colm")
End Sub
When I try to use it as a formula in Excel, it doesn't (Returns: #VALUE)
=print_name("Colm").
The real function is manipulating some data from a couple of other worksheets, carrying out a few calcs & then returns a value. I do not want to use a macro to run it, I want to be able to use a UDF.
Help!