Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 16
Default Find the first non 0 cell in a column

Hi,

I have a list of number starting with a bunch of 0 and I need to find the
first cell with a number different from 0. And copy this value on an other
sheet.

Any idea?
Thanks
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Find the first non 0 cell in a column


When you say you have a list of numbers starting with zero do you mean
0.nnnnnnn or are the cells formatted as text? if its the latter then
they are no longer numbers, if you were to use them in a calculation you
would lose the zero, can you confirm the format?

Lucile;538036 Wrote:
Hi,

I have a list of number starting with a bunch of 0 and I need to find
the
first cell with a number different from 0. And copy this value on an
other
sheet.

Any idea?
Thanks



--
Simon Lloyd

Regards,
Simon Lloyd
'Microsoft Office Help' (http://www.thecodecage.com)
------------------------------------------------------------------------
Simon Lloyd's Profile: http://www.thecodecage.com/forumz/member.php?userid=1
View this thread: http://www.thecodecage.com/forumz/sh...d.php?t=147876

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,501
Default Find the first non 0 cell in a column

Hi,

Try this. as long as there aonly numbers in the range

=INDEX(Sheet2!B1:B1000,MATCH(TRUE,Sheet2!B1:B1000 0,0))

This is an array formula which must be entered by pressing CTRL+Shift+Enter
'and not just Enter. If you do it correctly then Excel will put curly brackets
'around the formula {}. You can't type these yourself. If you edit the formula
'you must enter it again with CTRL+Shift+Enter.

Mike

"Lucile" wrote:

Hi,

I have a list of number starting with a bunch of 0 and I need to find the
first cell with a number different from 0. And copy this value on an other
sheet.

Any idea?
Thanks

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 16
Default Find the first non 0 cell in a column

I forgot...
I need a piece of code for a VBA program.

Thanks

"Mike H" wrote:

Hi,

Try this. as long as there aonly numbers in the range

=INDEX(Sheet2!B1:B1000,MATCH(TRUE,Sheet2!B1:B1000 0,0))

This is an array formula which must be entered by pressing CTRL+Shift+Enter
'and not just Enter. If you do it correctly then Excel will put curly brackets
'around the formula {}. You can't type these yourself. If you edit the formula
'you must enter it again with CTRL+Shift+Enter.

Mike

"Lucile" wrote:

Hi,

I have a list of number starting with a bunch of 0 and I need to find the
first cell with a number different from 0. And copy this value on an other
sheet.

Any idea?
Thanks

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,934
Default Find the first non 0 cell in a column

Are these numbers in a single column or single row? Or are they in an
arbitrary range? If in a column or row, does the list start at the first
cell in the column or row? Are there any empty cells in the range of cell?
Are these numbers whole numbers or can there be decimal values? Are you
looking for VB code or a worksheet formula?

--
Rick (MVP - Excel)


"Lucile" wrote in message
...
Hi,

I have a list of number starting with a bunch of 0 and I need to find the
first cell with a number different from 0. And copy this value on an other
sheet.

Any idea?
Thanks




  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 269
Default Find the first non 0 cell in a column

Try this

a=1
Do until Sheets("Sheet1").cells(A,1)<0
A=A+1
Loop
Sheets("Sheet2").cells(1,1)=Sheets("Sheet1").cells (A,1)

This assumes your data is starts in row 1, column 1 change as needed
--
If this helps, please remember to click yes.


"Lucile" wrote:

I forgot...
I need a piece of code for a VBA program.

Thanks

"Mike H" wrote:

Hi,

Try this. as long as there aonly numbers in the range

=INDEX(Sheet2!B1:B1000,MATCH(TRUE,Sheet2!B1:B1000 0,0))

This is an array formula which must be entered by pressing CTRL+Shift+Enter
'and not just Enter. If you do it correctly then Excel will put curly brackets
'around the formula {}. You can't type these yourself. If you edit the formula
'you must enter it again with CTRL+Shift+Enter.

Mike

"Lucile" wrote:

Hi,

I have a list of number starting with a bunch of 0 and I need to find the
first cell with a number different from 0. And copy this value on an other
sheet.

Any idea?
Thanks

  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 16
Default Find the first non 0 cell in a column

Thanks very much!

It seems to work!

"Paul C" wrote:

Try this

a=1
Do until Sheets("Sheet1").cells(A,1)<0
A=A+1
Loop
Sheets("Sheet2").cells(1,1)=Sheets("Sheet1").cells (A,1)

This assumes your data is starts in row 1, column 1 change as needed
--
If this helps, please remember to click yes.


"Lucile" wrote:

I forgot...
I need a piece of code for a VBA program.

Thanks

"Mike H" wrote:

Hi,

Try this. as long as there aonly numbers in the range

=INDEX(Sheet2!B1:B1000,MATCH(TRUE,Sheet2!B1:B1000 0,0))

This is an array formula which must be entered by pressing CTRL+Shift+Enter
'and not just Enter. If you do it correctly then Excel will put curly brackets
'around the formula {}. You can't type these yourself. If you edit the formula
'you must enter it again with CTRL+Shift+Enter.

Mike

"Lucile" wrote:

Hi,

I have a list of number starting with a bunch of 0 and I need to find the
first cell with a number different from 0. And copy this value on an other
sheet.

Any idea?
Thanks

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
Maddening Dilemma - Compare each cell within column a to each cell in column b and find unique matches [email protected] Excel Worksheet Functions 66 May 1st 23 03:44 AM
Find max value in one column and return the value of corrosponding cell in different column [email protected] Excel Worksheet Functions 5 October 16th 07 12:33 PM
find first empty cell in column and start transpose next row in that cell ali Excel Programming 3 July 21st 07 03:12 PM
Find First Non blank cell than find column header and return that value Silver Rose Excel Worksheet Functions 10 April 30th 07 05:56 PM
Move Cell in Column A to Column B when FIND juan Excel Programming 2 April 6th 04 10:20 PM


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

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

About Us

"It's about Microsoft Excel"