View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Peter Chatterton[_4_] Peter Chatterton[_4_] is offline
external usenet poster
 
Posts: 20
Default How do I get a Function to return Null?

I decided to test a Property value for Null
this time, instead of the Function ret. value,
but even tho the debugger shows it to be Nothing,
it doesn't satisfy IsNull.

'Sub-class':

Private rRow As Range

Public Function getNextRow As Range
iRow = iRow + 1
If iRow <= iRowCount Then
...
Else
Set rRow = Nothing
OR
rRow = Null
' Set getNextRow = Nothing
End If
End Function

Public Property Get rGetRow() As Range
Set rGetRow = rRow
End Property

Called from:

While True
oInput.getNextRow
If IsNull( oInput.rGetRow ) Then
MsgBox "DOESN'T COME HERE"
Exit Sub
End If

Peter

P.S. I said the debugger showed it to be Nothing,
but now it doesn't show anything to be Nothing or Null.