Thread: UDF help
View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
John C[_2_] John C[_2_] is offline
external usenet poster
 
Posts: 1,358
Default UDF help

Not quite as simple as that. I wish it were.
If A1 is either blank or empty, I want the cell where the NullCell function
is to appear empty.
If A1 is blank due to formula (i.e.: =""), then the NullCell function works,
but if there is NO data in there, I get an answer of 0.
--
John C


"Bob Phillips" wrote:

It is quite simple.

The value is returned as the function name

Function NullCell()

'some code
NullCell = somevalue
End Function

If you want to pass a value into the function you just declare an argument

Function NullCell(ByRef rng As Range)

'do something to rng
NullCell = somevalue
End Function

--
__________________________________
HTH

Bob

"John C" <johnc@stateofdenial wrote in message
...
What are some good references on creating UDF's?

While my real need is far more complex than I list here, I will give a
basic
basic situation.
A2: =IF(A1="","",A1)

I would prefer something more like
A2: =NullCell(A1)

Thank you.


--
John C