View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Wigi Wigi is offline
external usenet poster
 
Posts: 396
Default How to test if a cell is empty in a custom function?

Hi

eg.

If Len(Range("A1").Value) = 0 then msgbox "it's empty"



--
Wigi
http://www.wimgielis.be = Excel/VBA, soccer and music


"BingBong" wrote:

Hi,

I'm somewhat new to Excel VBA so pardon me if this question is
simplistic

I am writing a custom function in Excel 07 that performs a calculation
based on 4 input cells in the worksheet and returns one value. I want
this function to return a null value (or a "" vlaue) if one of the
input cells is empty.

Now this would be easy using ISEMPTY using an equation but how do I do
something similar in a VBA custom function? I can't get this to work.

I would think that I have to pass a range to ISEMPTY in a custom
function but don't know how to do that in VBA.

I'm stuck. Can anyone help me here?

Thanks,

BB