.cells reference?

J

John

Hi I am trying to find when a value crosses above or below zero in a table
for multiple test objects... my code does not return any crosses... when
column "B" should find one

Sub Scorecross()
Sheets("Scores").Select
lastticker = Range("b2").End(xlToRight).Address
lstcol = Range("b2").End(xlToRight).Column
todayrow = Range("a2").End(xlDown).Row
For Each i In Sheets("Scores").Range("b2", lastticker)
If Cells(i.Column, todayrow) < 0 And Cells(i.Column, todayrow - 1) > 0
Then
nxtwatch = Sheets("watch list").Range("a4000").End(xlUp).Address
Sheets("watch list").Range(nxtwatch).Offset(1, 0) =
Sheets("scores").Cells(i.Column, 2)
Sheets("watch list").Range(nxtwatch).Offset(1, 1) =
Sheets("scores").Cells(i.Column, todayrow)
Sheets("watch list").Range(nxtwatch).Offset(1, 2) = "Cross UP"
Sheets("watch list").Range(nxtwatch).Offset(1, 3) =
Sheets("Scores").Range("a" & todayrow).Value
End If
If Cells(i.Column & todayrow) < 0 And Cells(i.Column & todayrow - 1) < 0
Then
nxtwatch = Sheets("watch list").Range("a4000").End(xlUp).Address
Sheets("watch list").Range(nxtwatch).Offset(1, 0) =
Sheets("scores").Cells(i.Column, 2)
Sheets("watch list").Range(nxtwatch).Offset(1, 1) =
Sheets("scores").Cells(i.Column, todayrow)
Sheets("watch list").Range(nxtwatch).Offset(1, 2) = "Cross DOWN"
Sheets("watch list").Range(nxtwatch).Offset(1, 3) =
Sheets("Scores").Range("a" & todayrow).Value
End If
Next
'Call scoreEmail
Sheets("watch list").Select
End Sub


Thanks for any help!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top