Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 50
Default Bypas Nil Values

A formula delivers a result 0 or 1 in certain conditions in the cells in a
coluumn.

I need to start scanning from row 1 to bypass the initial 0 value cells to
reach the first positive value in the column.

How do I do it?

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,501
Default Bypas Nil Values

Hi,

A bit thin on information but maybe this will get you started

Sub sonic()
lastrow = Cells(Cells.Rows.Count, "A").End(xlUp).Row
Set myrange = Range("A1:A" & lastrow)
For Each c In myrange
If c.Value < 0 Then
'do something
MsgBox c.Address
End If
Next
End Sub

Mike

"a m spock" wrote:

A formula delivers a result 0 or 1 in certain conditions in the cells in a
coluumn.

I need to start scanning from row 1 to bypass the initial 0 value cells to
reach the first positive value in the column.

How do I do it?

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,124
Default Bypas Nil Values

See reply in your other post. Why did you do this???
in a columnGet to first positive value

e: Bypas Nil Values


--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"a m spock" wrote in message
...
A formula delivers a result 0 or 1 in certain conditions in the cells in a
coluumn.

I need to start scanning from row 1 to bypass the initial 0 value cells to
reach the first positive value in the column.

How do I do it?


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 50
Default Bypas Nil Values


the data in the computed column on sales completed is something like this.
the data is dynamic and changes as each transaction is added to the workshet.
i need a macro which will, starting from anywhere on the worksheet take the
cursor to the cell with the last positive value i.e. 800,000

Trades Completed
0
200,000
1,000
1,000,000
0
0
0
0
800,000
0
0
0


  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,124
Default Bypas Nil Values

One way

Sub gotolastpostitivevalue()
mc = "f"
For i = Cells(Rows.Count, mc).End(xlUp).Row To 2 Step -1
If Cells(i, mc) 0 Then
Cells(i, mc).Select
Exit Sub
End If
Next i
End Sub

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"a m spock" wrote in message
...

the data in the computed column on sales completed is something like this.
the data is dynamic and changes as each transaction is added to the
workshet.
i need a macro which will, starting from anywhere on the worksheet take
the
cursor to the cell with the last positive value i.e. 800,000

Trades Completed
0
200,000
1,000
1,000,000
0
0
0
0
800,000
0
0
0





  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 50
Default Bypas Nil Values

many thanks. the macro works but
it has selected a column at random where it finds the last positive value
evry time. how do i specify the column where i want the avtivity to happen?

Pardon my ignorance.

"Don Guillett" wrote:

One way

Sub gotolastpostitivevalue()
mc = "f"
For i = Cells(Rows.Count, mc).End(xlUp).Row To 2 Step -1
If Cells(i, mc) 0 Then
Cells(i, mc).Select
Exit Sub
End If
Next i
End Sub

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"a m spock" wrote in message
...

the data in the computed column on sales completed is something like this.
the data is dynamic and changes as each transaction is added to the
workshet.
i need a macro which will, starting from anywhere on the worksheet take
the
cursor to the cell with the last positive value i.e. 800,000

Trades Completed
0
200,000
1,000
1,000,000
0
0
0
0
800,000
0
0
0




  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 50
Default Bypas Nil Values

sorry fro prev post. just figured it out.
thanks again!!!

"Don Guillett" wrote:

One way

Sub gotolastpostitivevalue()
mc = "f"
For i = Cells(Rows.Count, mc).End(xlUp).Row To 2 Step -1
If Cells(i, mc) 0 Then
Cells(i, mc).Select
Exit Sub
End If
Next i
End Sub

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"a m spock" wrote in message
...

the data in the computed column on sales completed is something like this.
the data is dynamic and changes as each transaction is added to the
workshet.
i need a macro which will, starting from anywhere on the worksheet take
the
cursor to the cell with the last positive value i.e. 800,000

Trades Completed
0
200,000
1,000
1,000,000
0
0
0
0
800,000
0
0
0




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
Excel 2007 doesnt show Y-axis values when the values are small. outback Charts and Charting in Excel 2 October 26th 08 01:37 AM
Exclude #N/A values and Return Numeric values to consecutive cells in Single Row Sam via OfficeKB.com Excel Worksheet Functions 5 February 9th 08 03:07 AM
Why does this code remove Duplicate Values, by showing only 1, but it does NOT show Unique values for some reason ? Corey Excel Programming 4 February 23rd 07 02:00 AM
Search/Filter to find values in another range based on two cell values Andy Excel Programming 2 April 29th 04 04:08 PM
Predict Y-values on new X-values based on other actual X and Y values? NorTor Excel Programming 2 August 10th 03 03:08 PM


All times are GMT +1. The time now is 12:11 PM.

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"