View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Gary''s Student Gary''s Student is offline
external usenet poster
 
Posts: 11,058
Default Function to find the first cell that is not zero

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