Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 20
Default Function to find the first cell that is not zero

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




  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
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





  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 15,768
Default Function to find the first cell that is not zero

You programmers always want to reinvent the wheel!

Biff

"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







  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 11,058
Default Function to find the first cell that is not zero

You are, of course, correct.

You have proved to me over and over in your posts that you can do things
with formulas that I though to be completely impossible without VBA. I have
actually bookmarked a Google Groups search of your material.
--
Gary''s Student - gsnu200728


"T. Valko" wrote:

You programmers always want to reinvent the wheel!

Biff

"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








  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 15,768
Default Function to find the first cell that is not zero

I have actually bookmarked a Google Groups
search of your material.


If I were you I'd change the "search for author" criteria to Harlan Grove.

Biff

"Gary''s Student" wrote in message
...
You are, of course, correct.

You have proved to me over and over in your posts that you can do things
with formulas that I though to be completely impossible without VBA. I
have
actually bookmarked a Google Groups search of your material.
--
Gary''s Student - gsnu200728


"T. Valko" wrote:

You programmers always want to reinvent the wheel!

Biff

"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












  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3,268
Default Function to find the first cell that is not zero

Domenic is a good search criteria as well, he is not as polite as Harlan
though :))


--
Regards,

Peo Sjoblom


"T. Valko" wrote in message
...
I have actually bookmarked a Google Groups
search of your material.


If I were you I'd change the "search for author" criteria to Harlan Grove.

Biff

"Gary''s Student" wrote in
message ...
You are, of course, correct.

You have proved to me over and over in your posts that you can do things
with formulas that I though to be completely impossible without VBA. I
have
actually bookmarked a Google Groups search of your material.
--
Gary''s Student - gsnu200728


"T. Valko" wrote:

You programmers always want to reinvent the wheel!

Biff

"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












  #7   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 15,768
Default Function to find the first cell that is not zero

LOL!

Biff

"Peo Sjoblom" wrote in message
...
Domenic is a good search criteria as well, he is not as polite as Harlan
though :))


--
Regards,

Peo Sjoblom


"T. Valko" wrote in message
...
I have actually bookmarked a Google Groups
search of your material.


If I were you I'd change the "search for author" criteria to Harlan
Grove.

Biff

"Gary''s Student" wrote in
message ...
You are, of course, correct.

You have proved to me over and over in your posts that you can do things
with formulas that I though to be completely impossible without VBA. I
have
actually bookmarked a Google Groups search of your material.
--
Gary''s Student - gsnu200728


"T. Valko" wrote:

You programmers always want to reinvent the wheel!

Biff

"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














  #8   Report Post  
Posted to microsoft.public.excel.worksheet.functions
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







Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Function to find the first cell that is not zero Mark[_3_] Excel Worksheet Functions 13 June 11th 07 01:11 PM
find cell function flyingmeatball Excel Worksheet Functions 4 August 9th 06 11:58 PM
Function to find the address of a cell Ron Rosenfeld Excel Worksheet Functions 23 December 11th 05 04:06 PM
how can I use a function to find out if an individual cell is par. nick.pattison Excel Worksheet Functions 3 January 13th 05 06:45 PM
Is there a function for "not isblank" (find a cell that has a val. Jim Excel Worksheet Functions 3 December 8th 04 07:29 AM


All times are GMT +1. The time now is 01:59 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"