View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Mark[_3_] Mark[_3_] is offline
external usenet poster
 
Posts: 20
Default Function to find the first cell that is not zero

Many thanks. I'll try it after I get home agian.

Cheers


"Gary''s Student" wrote in message
...
Function nonzero(r As Range) As String
nonzero = ""
For Each rr In r
If rr.Value < 0 Then
nonzero = rr.Address
Exit Function
End If
Next
End Function

so if in row 17, F17 contains the first non-zero value then:

=nonzero(17:17)

will return

$F$17
--
Gary''s Student - gsnu200727


"Mark" wrote:

Hi

I want to find the first cell that is not zero "0" across a row. I am
also
trying a VBA solution, but is there perchance a function that will do
this?

Mark